Merge photo comments feature #114
@ -123,6 +123,12 @@ class Album extends Model
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null($current->parent_album_id) && $current->is_permissions_inherited)
|
||||
{
|
||||
// Use default permissions list
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $current->id;
|
||||
}
|
||||
|
||||
|
9
app/AlbumDefaultAnonymousPermission.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AlbumDefaultAnonymousPermission extends Model
|
||||
{
|
||||
}
|
9
app/AlbumDefaultGroupPermission.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AlbumDefaultGroupPermission extends Model
|
||||
{
|
||||
}
|
9
app/AlbumDefaultUserPermission.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AlbumDefaultUserPermission extends Model
|
||||
{
|
||||
}
|
@ -98,6 +98,8 @@ class ConfigHelper
|
||||
return array(
|
||||
'albums_menu_parents_only' => false,
|
||||
'albums_menu_number_items' => 10,
|
||||
'allow_photo_comments' => false,
|
||||
'allow_photo_comments_anonymous' => true,
|
||||
'allow_self_registration' => true,
|
||||
'analytics_code' => '',
|
||||
'app_name' => trans('global.app_name'),
|
||||
@ -111,6 +113,10 @@ class ConfigHelper
|
||||
'hotlink_protection' => false,
|
||||
'items_per_page' => 12,
|
||||
'items_per_page_admin' => 10,
|
||||
'moderate_anonymous_users' => true,
|
||||
'moderate_known_users' => true,
|
||||
'photo_comments_allowed_html' => 'p,div,span,a,b,i,u',
|
||||
'photo_comments_thread_depth' => 3,
|
||||
'public_statistics' => true,
|
||||
'recaptcha_enabled_registration' => false,
|
||||
'recaptcha_secret_key' => '',
|
||||
|
@ -3,6 +3,9 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Album;
|
||||
use App\AlbumDefaultAnonymousPermission;
|
||||
use App\AlbumDefaultGroupPermission;
|
||||
use App\AlbumDefaultUserPermission;
|
||||
use App\Permission;
|
||||
use App\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@ -50,6 +53,23 @@ class PermissionsHelper
|
||||
->count() > 0;
|
||||
}
|
||||
|
||||
public function usersWhoCan_Album(Album $album, $permission)
|
||||
{
|
||||
$users = DB::table('album_permissions_cache')
|
||||
->join('permissions', 'permissions.id', '=', 'album_permissions_cache.permission_id')
|
||||
->where([
|
||||
['album_permissions_cache.album_id', $album->id],
|
||||
['permissions.section', 'album'],
|
||||
['permissions.description', $permission]
|
||||
])
|
||||
->get();
|
||||
|
||||
// Include the album's owner (who can do everything)
|
||||
$users->push($album->user);
|
||||
|
||||
return $users;
|
||||
}
|
||||
|
||||
private function rebuildAlbumCache()
|
||||
{
|
||||
// Get a list of albums
|
||||
@ -60,6 +80,10 @@ class PermissionsHelper
|
||||
$albumGroupPermissions = DB::table('album_group_permissions')->get();
|
||||
$albumAnonPermissions = DB::table('album_anonymous_permissions')->get();
|
||||
|
||||
$defaultAlbumUserPermissions = AlbumDefaultUserPermission::all();
|
||||
$defaultAlbumGroupPermissions = AlbumDefaultGroupPermission::all();
|
||||
$defaultAnonPermissions = AlbumDefaultAnonymousPermission::all();
|
||||
|
||||
// Get a list of all user->group memberships
|
||||
$userGroups = DB::table('user_groups')->get();
|
||||
|
||||
@ -71,60 +95,109 @@ class PermissionsHelper
|
||||
{
|
||||
$effectiveAlbumID = $album->effectiveAlbumIDForPermissions();
|
||||
|
||||
$anonymousPermissions = array_filter($albumAnonPermissions->toArray(), function($item) use ($effectiveAlbumID)
|
||||
if ($effectiveAlbumID === 0)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
/* Use the default permissions list */
|
||||
|
||||
foreach ($anonymousPermissions as $anonymousPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $anonymousPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
$userPermissions = array_filter($albumUserPermissions->toArray(), function($item) use ($effectiveAlbumID)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
|
||||
foreach ($userPermissions as $userPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userPermission->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $userPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
$groupPermissions = array_filter($albumGroupPermissions->toArray(), function($item) use ($effectiveAlbumID)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
|
||||
foreach ($groupPermissions as $groupPermission)
|
||||
{
|
||||
// Get a list of users in this group, and add one per user
|
||||
$usersInGroup = array_filter($userGroups->toArray(), function($item) use ($groupPermission)
|
||||
{
|
||||
return $item->group_id = $groupPermission->group_id;
|
||||
});
|
||||
|
||||
foreach ($usersInGroup as $userGroup)
|
||||
foreach ($defaultAnonPermissions as $anonymousPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userGroup->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $groupPermission->permission_id,
|
||||
'permission_id' => $anonymousPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($defaultAlbumUserPermissions as $userPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userPermission->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $userPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($defaultAlbumGroupPermissions as $groupPermission)
|
||||
{
|
||||
// Get a list of users in this group, and add one per user
|
||||
$usersInGroup = array_filter($userGroups->toArray(), function ($item) use ($groupPermission)
|
||||
{
|
||||
return $item->group_id = $groupPermission->group_id;
|
||||
});
|
||||
|
||||
foreach ($usersInGroup as $userGroup)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userGroup->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $groupPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Use the specified album-specific permissions */
|
||||
$anonymousPermissions = array_filter($albumAnonPermissions->toArray(), function ($item) use ($effectiveAlbumID)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
|
||||
foreach ($anonymousPermissions as $anonymousPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $anonymousPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
$userPermissions = array_filter($albumUserPermissions->toArray(), function ($item) use ($effectiveAlbumID)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
|
||||
foreach ($userPermissions as $userPermission)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userPermission->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $userPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
|
||||
$groupPermissions = array_filter($albumGroupPermissions->toArray(), function ($item) use ($effectiveAlbumID)
|
||||
{
|
||||
return ($item->album_id == $effectiveAlbumID);
|
||||
});
|
||||
|
||||
foreach ($groupPermissions as $groupPermission)
|
||||
{
|
||||
// Get a list of users in this group, and add one per user
|
||||
$usersInGroup = array_filter($userGroups->toArray(), function ($item) use ($groupPermission)
|
||||
{
|
||||
return $item->group_id = $groupPermission->group_id;
|
||||
});
|
||||
|
||||
foreach ($usersInGroup as $userGroup)
|
||||
{
|
||||
$permissionsCache[] = [
|
||||
'user_id' => $userGroup->user_id,
|
||||
'album_id' => $album->id,
|
||||
'permission_id' => $groupPermission->permission_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,9 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Album;
|
||||
use App\AlbumDefaultAnonymousPermission;
|
||||
use App\AlbumDefaultGroupPermission;
|
||||
use App\AlbumDefaultUserPermission;
|
||||
use App\AlbumRedirect;
|
||||
use App\Facade\Theme;
|
||||
use App\Facade\UserConfig;
|
||||
@ -28,6 +31,30 @@ use Illuminate\Support\Facades\View;
|
||||
|
||||
class AlbumController extends Controller
|
||||
{
|
||||
public static function doesGroupHaveDefaultPermission(Group $group, Permission $permission)
|
||||
{
|
||||
return AlbumDefaultGroupPermission::where([
|
||||
'group_id' => $group->id,
|
||||
'permission_id' => $permission->id
|
||||
])->count() > 0;
|
||||
}
|
||||
|
||||
public static function doesUserHaveDefaultPermission($user, Permission $permission)
|
||||
{
|
||||
// User will be null for anonymous users
|
||||
if (is_null($user))
|
||||
{
|
||||
return AlbumDefaultAnonymousPermission::where(['permission_id' => $permission->id])->count() > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return AlbumDefaultUserPermission::where([
|
||||
'user_id' => $user->id,
|
||||
'permission_id' => $permission->id
|
||||
])->count() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
@ -83,6 +110,41 @@ class AlbumController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function defaultPermissions()
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-albums');
|
||||
|
||||
$addNewGroups = [];
|
||||
$existingGroups = [];
|
||||
foreach (Group::orderBy('name')->get() as $group)
|
||||
{
|
||||
if (AlbumDefaultGroupPermission::where('group_id', $group->id)->count() == 0)
|
||||
{
|
||||
$addNewGroups[] = $group;
|
||||
}
|
||||
else
|
||||
{
|
||||
$existingGroups[] = $group;
|
||||
}
|
||||
}
|
||||
|
||||
$existingUsers = [];
|
||||
foreach (User::orderBy('name')->get() as $user)
|
||||
{
|
||||
if (AlbumDefaultUserPermission::where('user_id', $user->id)->count() > 0)
|
||||
{
|
||||
$existingUsers[] = $user;
|
||||
}
|
||||
}
|
||||
|
||||
return Theme::render('admin.album_default_permissions', [
|
||||
'add_new_groups' => $addNewGroups,
|
||||
'all_permissions' => Permission::where('section', 'album')->get(),
|
||||
'existing_groups' => $existingGroups,
|
||||
'existing_users' => $existingUsers
|
||||
]);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-albums');
|
||||
@ -215,6 +277,130 @@ class AlbumController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function setDefaultGroupPermissions(Request $request)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-albums');
|
||||
|
||||
if ($request->get('action') == 'add_group' && $request->has('group_id'))
|
||||
{
|
||||
/* Add a new group to the default permission list */
|
||||
|
||||
/** @var Group $group */
|
||||
$group = Group::where('id', $request->get('group_id'))->first();
|
||||
if (is_null($group))
|
||||
{
|
||||
App::abort(404);
|
||||
}
|
||||
|
||||
// Link all default permissions to the group
|
||||
/** @var Permission $permission */
|
||||
foreach (Permission::where(['section' => 'album', 'is_default' => true])->get() as $permission)
|
||||
{
|
||||
$defaultPermission = new AlbumDefaultGroupPermission();
|
||||
$defaultPermission->group_id = $group->id;
|
||||
$defaultPermission->permission_id = $permission->id;
|
||||
$defaultPermission->save();
|
||||
}
|
||||
}
|
||||
else if ($request->get('action') == 'update_group_permissions')
|
||||
{
|
||||
/* Update existing group permissions for this album */
|
||||
AlbumDefaultGroupPermission::truncate();
|
||||
|
||||
$permissions = $request->get('permissions');
|
||||
if (is_array($permissions))
|
||||
{
|
||||
foreach ($permissions as $groupID => $permissionIDs)
|
||||
{
|
||||
foreach ($permissionIDs as $permissionID)
|
||||
{
|
||||
$defaultPermission = new AlbumDefaultGroupPermission();
|
||||
$defaultPermission->group_id = $groupID;
|
||||
$defaultPermission->permission_id = $permissionID;
|
||||
$defaultPermission->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild the permissions cache
|
||||
$helper = new PermissionsHelper();
|
||||
$helper->rebuildCache();
|
||||
|
||||
return redirect(route('albums.defaultPermissions'));
|
||||
}
|
||||
|
||||
public function setDefaultUserPermissions(Request $request)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-albums');
|
||||
|
||||
if ($request->get('action') == 'add_user' && $request->has('user_id'))
|
||||
{
|
||||
/* Add a new user to the permission list for this album */
|
||||
|
||||
/** @var User $user */
|
||||
$user = User::where('id', $request->get('user_id'))->first();
|
||||
if (is_null($user))
|
||||
{
|
||||
App::abort(404);
|
||||
}
|
||||
|
||||
// Link all default permissions to the group
|
||||
/** @var Permission $permission */
|
||||
foreach (Permission::where(['section' => 'album', 'is_default' => true])->get() as $permission)
|
||||
{
|
||||
$defaultPermission = new AlbumDefaultUserPermission();
|
||||
$defaultPermission->user_id = $user->id;
|
||||
$defaultPermission->permission_id = $permission->id;
|
||||
$defaultPermission->save();
|
||||
}
|
||||
}
|
||||
else if ($request->get('action') == 'update_user_permissions')
|
||||
{
|
||||
/* Update existing user and anonymous permissions for this album */
|
||||
AlbumDefaultAnonymousPermission::truncate();
|
||||
AlbumDefaultUserPermission::truncate();
|
||||
|
||||
$permissions = $request->get('permissions');
|
||||
if (is_array($permissions))
|
||||
{
|
||||
if (isset($permissions['anonymous']))
|
||||
{
|
||||
foreach ($permissions['anonymous'] as $permissionID)
|
||||
{
|
||||
$defaultPermission = new AlbumDefaultAnonymousPermission();
|
||||
$defaultPermission->permission_id = $permissionID;
|
||||
$defaultPermission->save();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($permissions as $key => $value)
|
||||
{
|
||||
$userID = intval($key);
|
||||
if ($userID == 0)
|
||||
{
|
||||
// Skip non-numeric IDs (e.g. anonymous)
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($value as $permissionID)
|
||||
{
|
||||
$defaultPermission = new AlbumDefaultUserPermission();
|
||||
$defaultPermission->user_id = $userID;
|
||||
$defaultPermission->permission_id = $permissionID;
|
||||
$defaultPermission->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild the permissions cache
|
||||
$helper = new PermissionsHelper();
|
||||
$helper->rebuildCache();
|
||||
|
||||
return redirect(route('albums.defaultPermissions'));
|
||||
}
|
||||
|
||||
public function setGroupPermissions(Request $request, $id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-albums');
|
||||
@ -474,21 +660,41 @@ class AlbumController extends Controller
|
||||
$album->generateUrlPath();
|
||||
$album->save();
|
||||
|
||||
// Link all default permissions to anonymous users (if a public album)
|
||||
if (!$album->is_permissions_inherited)
|
||||
// Link the default permissions (if a public album)
|
||||
$isPrivate = (strtolower($request->get('is_private')) == 'on');
|
||||
if (!$album->is_permissions_inherited && !$isPrivate)
|
||||
{
|
||||
$isPrivate = (strtolower($request->get('is_private')) == 'on');
|
||||
$defaultAlbumUserPermissions = AlbumDefaultUserPermission::all();
|
||||
$defaultAlbumGroupPermissions = AlbumDefaultGroupPermission::all();
|
||||
$defaultAnonPermissions = AlbumDefaultAnonymousPermission::all();
|
||||
|
||||
if (!$isPrivate)
|
||||
/** @var AlbumDefaultAnonymousPermission $permission */
|
||||
foreach ($defaultAnonPermissions as $permission)
|
||||
{
|
||||
/** @var Permission $permission */
|
||||
foreach (Permission::where(['section' => 'album', 'is_default' => true])->get() as $permission)
|
||||
{
|
||||
$album->anonymousPermissions()->attach($permission->id, [
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
]);
|
||||
}
|
||||
$album->anonymousPermissions()->attach($permission->permission_id, [
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/** @var AlbumDefaultGroupPermission $permission */
|
||||
foreach ($defaultAlbumGroupPermissions as $permission)
|
||||
{
|
||||
$album->groupPermissions()->attach($permission->permission_id, [
|
||||
'group_id' => $permission->group_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/** @var AlbumDefaultUserPermission $permission */
|
||||
foreach ($defaultAlbumUserPermissions as $permission)
|
||||
{
|
||||
$album->userPermissions()->attach($permission->permission_id, [
|
||||
'user_id' => $permission->user_id,
|
||||
'created_at' => new \DateTime(),
|
||||
'updated_at' => new \DateTime()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ use App\Http\Requests\SaveSettingsRequest;
|
||||
use App\Label;
|
||||
use App\Mail\TestMailConfig;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\Services\GiteaService;
|
||||
use App\Services\GithubService;
|
||||
use App\Services\PhotoService;
|
||||
@ -140,6 +141,7 @@ class DefaultController extends Controller
|
||||
$photoCount = Photo::all()->count();
|
||||
$groupCount = Group::all()->count();
|
||||
$labelCount = Label::all()->count();
|
||||
$commentCount = PhotoComment::whereNotNull('approved_at')->count();
|
||||
$userCount = User::where('is_activated', true)->count();
|
||||
|
||||
$minMetadataVersion = Photo::min('metadata_version');
|
||||
@ -157,6 +159,7 @@ class DefaultController extends Controller
|
||||
return Theme::render('admin.index', [
|
||||
'album_count' => $albumCount,
|
||||
'app_version' => config('app.version'),
|
||||
'comment_count' => $commentCount,
|
||||
'group_count' => $groupCount,
|
||||
'label_count' => $labelCount,
|
||||
'memory_limit' => ini_get('memory_limit'),
|
||||
@ -231,9 +234,13 @@ class DefaultController extends Controller
|
||||
|
||||
$checkboxKeys = [
|
||||
'albums_menu_parents_only',
|
||||
'allow_photo_comments',
|
||||
'allow_photo_comments_anonymous',
|
||||
'allow_self_registration',
|
||||
'enable_visitor_hits',
|
||||
'hotlink_protection',
|
||||
'moderate_anonymous_users',
|
||||
'moderate_known_users',
|
||||
'recaptcha_enabled_registration',
|
||||
'remove_copyright',
|
||||
'require_email_verification',
|
||||
@ -252,6 +259,8 @@ class DefaultController extends Controller
|
||||
'facebook_app_secret',
|
||||
'google_app_id',
|
||||
'google_app_secret',
|
||||
'photo_comments_allowed_html',
|
||||
'photo_comments_thread_depth',
|
||||
'sender_address',
|
||||
'sender_name',
|
||||
'smtp_server',
|
||||
|
@ -34,7 +34,7 @@ class GroupController extends Controller
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel();
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-groups');
|
||||
|
||||
$group = Group::where('id', intval($id))->first();
|
||||
if (is_null($group))
|
||||
|
375
app/Http/Controllers/Admin/PhotoCommentController.php
Normal file
@ -0,0 +1,375 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Facade\UserConfig;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Mail\PhotoCommentApproved;
|
||||
use App\Mail\PhotoCommentApprovedUser;
|
||||
use App\Mail\PhotoCommentRepliedTo;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class PhotoCommentController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
View::share('is_admin', true);
|
||||
}
|
||||
|
||||
public function applyBulkAction(Request $request)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$commentIDs = $request->get('comment_ids');
|
||||
if (is_null($commentIDs) || !is_array($commentIDs) || count($commentIDs) == 0)
|
||||
{
|
||||
$request->session()->flash('warning', trans('admin.no_comments_selected_message'));
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
$comments = PhotoComment::whereIn('id', $commentIDs)->get();
|
||||
$commentsActioned = 0;
|
||||
|
||||
if ($request->has('bulk_delete'))
|
||||
{
|
||||
/** @var PhotoComment $comment */
|
||||
foreach ($comments as $comment)
|
||||
{
|
||||
$comment->delete();
|
||||
$commentsActioned++;
|
||||
}
|
||||
|
||||
$request->session()->flash('success', trans_choice('admin.bulk_comments_deleted', $commentsActioned, ['number' => $commentsActioned]));
|
||||
}
|
||||
else if ($request->has('bulk_approve'))
|
||||
{
|
||||
/** @var PhotoComment $comment */
|
||||
foreach ($comments as $comment)
|
||||
{
|
||||
if ($comment->isApproved())
|
||||
{
|
||||
// Don't make changes if already approved
|
||||
continue;
|
||||
}
|
||||
|
||||
// Mark as approved
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = $this->getUser()->id;
|
||||
|
||||
// The comment may have already been rejected - remove the data if so
|
||||
$comment->rejected_at = null;
|
||||
$comment->rejected_user_id = null;
|
||||
|
||||
// Send the notification e-mail to the owner
|
||||
|
||||
$comment->save();
|
||||
$commentsActioned++;
|
||||
|
||||
// Send e-mail notification
|
||||
$photo = $comment->photo;
|
||||
$album = $photo->album;
|
||||
$this->notifyAlbumOwnerAndPoster($album, $photo, $comment);
|
||||
}
|
||||
|
||||
$request->session()->flash('success', trans_choice('admin.bulk_comments_approved', $commentsActioned, ['number' => $commentsActioned]));
|
||||
}
|
||||
else if ($request->has('bulk_reject'))
|
||||
{
|
||||
/** @var PhotoComment $comment */
|
||||
foreach ($comments as $comment)
|
||||
{
|
||||
if ($comment->isRejected())
|
||||
{
|
||||
// Don't make changes if already rejected
|
||||
continue;
|
||||
}
|
||||
|
||||
// Mark as rejected
|
||||
$comment->rejected_at = new \DateTime();
|
||||
$comment->rejected_user_id = $this->getUser()->id;
|
||||
|
||||
// The comment may have already been approved - remove the data if so
|
||||
$comment->approved_at = null;
|
||||
$comment->approved_user_id = null;
|
||||
|
||||
$comment->save();
|
||||
$commentsActioned++;
|
||||
}
|
||||
|
||||
$request->session()->flash('success', trans_choice('admin.bulk_comments_approved', $commentsActioned, ['number' => $commentsActioned]));
|
||||
}
|
||||
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
public function approve($id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
return Theme::render('admin.approve_comment', ['comment' => $comment]);
|
||||
}
|
||||
|
||||
public function bulkAction(Request $request)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$commentIDs = $request->get('comment_ids');
|
||||
if (is_null($commentIDs) || !is_array($commentIDs) || count($commentIDs) == 0)
|
||||
{
|
||||
$request->session()->flash('warning', trans('admin.no_comments_selected_message'));
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
if ($request->has('bulk_delete'))
|
||||
{
|
||||
if (count($commentIDs) == 1)
|
||||
{
|
||||
// Single comment selected - redirect to the single delete page
|
||||
return redirect(route('comments.delete', ['id' => $commentIDs[0]]));
|
||||
}
|
||||
|
||||
// Show the view to confirm the delete
|
||||
return Theme::render('admin.bulk_delete_comments', [
|
||||
'comment_count' => count($commentIDs),
|
||||
'comment_ids' => $commentIDs
|
||||
]);
|
||||
}
|
||||
else if ($request->has('bulk_approve'))
|
||||
{
|
||||
if (count($commentIDs) == 1)
|
||||
{
|
||||
// Single comment selected - redirect to the single approve page
|
||||
return redirect(route('comments.approve', ['id' => $commentIDs[0]]));
|
||||
}
|
||||
|
||||
// Show the view to confirm the approval
|
||||
return Theme::render('admin.bulk_approve_comments', [
|
||||
'comment_count' => count($commentIDs),
|
||||
'comment_ids' => $commentIDs
|
||||
]);
|
||||
}
|
||||
else if ($request->has('bulk_reject'))
|
||||
{
|
||||
if (count($commentIDs) == 1)
|
||||
{
|
||||
// Single comment selected - redirect to the single reject page
|
||||
return redirect(route('comments.reject', ['id' => $commentIDs[0]]));
|
||||
}
|
||||
|
||||
// Show the view to confirm the rejection
|
||||
return Theme::render('admin.bulk_reject_comments', [
|
||||
'comment_count' => count($commentIDs),
|
||||
'comment_ids' => $commentIDs
|
||||
]);
|
||||
}
|
||||
|
||||
// Unrecognised action - simply redirect back to the index page
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
public function confirmApprove(Request $request, $id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
if ($comment->isApproved())
|
||||
{
|
||||
// Comment has already been approved
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
// Mark as approved
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = $this->getUser()->id;
|
||||
|
||||
// The comment may have already been rejected - remove the data if so
|
||||
$comment->rejected_at = null;
|
||||
$comment->rejected_user_id = null;
|
||||
|
||||
$comment->save();
|
||||
|
||||
$request->session()->flash('success', trans('admin.comment_approval_successful', [
|
||||
'author_name' => $comment->authorDisplayName()
|
||||
]));
|
||||
|
||||
// Send e-mail notification
|
||||
$photo = $comment->photo;
|
||||
$album = $photo->album;
|
||||
$this->notifyAlbumOwnerAndPoster($album, $photo, $comment);
|
||||
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
public function confirmReject(Request $request, $id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
if ($comment->isRejected())
|
||||
{
|
||||
// Comment has already been rejected
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
// Mark as rejected
|
||||
$comment->rejected_at = new \DateTime();
|
||||
$comment->rejected_user_id = $this->getUser()->id;
|
||||
|
||||
// The comment may have already been approved - remove the data if so
|
||||
$comment->approved_at = null;
|
||||
$comment->approved_user_id = null;
|
||||
|
||||
$comment->save();
|
||||
|
||||
$request->session()->flash('success', trans('admin.comment_rejection_successful', [
|
||||
'author_name' => $comment->authorDisplayName()
|
||||
]));
|
||||
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
return Theme::render('admin.delete_comment', ['comment' => $comment]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
/** @var PhotoComment $comment */
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
$comment->delete();
|
||||
$request->session()->flash('success', trans('admin.comment_deletion_successful', [
|
||||
'author_name' => $comment->authorDisplayName()
|
||||
]));
|
||||
|
||||
return redirect(route('comments.index'));
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$validStatusList = [
|
||||
'all',
|
||||
'pending',
|
||||
'approved',
|
||||
'rejected'
|
||||
];
|
||||
|
||||
$filterStatus = $request->get('status', 'all');
|
||||
if (!in_array($filterStatus, $validStatusList))
|
||||
{
|
||||
$filterStatus = $validStatusList[0];
|
||||
}
|
||||
|
||||
$comments = PhotoComment::with('photo')
|
||||
->with('photo.album')
|
||||
->orderBy('created_at', 'desc');
|
||||
|
||||
switch (strtolower($filterStatus))
|
||||
{
|
||||
case 'approved':
|
||||
$comments->whereNotNull('approved_at')
|
||||
->whereNull('rejected_at');
|
||||
break;
|
||||
|
||||
case 'pending':
|
||||
$comments->whereNull('approved_at')
|
||||
->whereNull('rejected_at');
|
||||
break;
|
||||
|
||||
case 'rejected':
|
||||
$comments->whereNull('approved_at')
|
||||
->whereNotNull('rejected_at');
|
||||
break;
|
||||
}
|
||||
|
||||
return Theme::render('admin.list_comments', [
|
||||
'comments' => $comments->paginate(UserConfig::get('items_per_page')),
|
||||
'filter_status' => $filterStatus,
|
||||
'success' => $request->session()->get('success'),
|
||||
'warning' => $request->session()->get('warning')
|
||||
]);
|
||||
}
|
||||
|
||||
public function reject($id)
|
||||
{
|
||||
$this->authorizeAccessToAdminPanel('admin:manage-comments');
|
||||
|
||||
$comment = $this->loadCommentByID($id);
|
||||
|
||||
return Theme::render('admin.reject_comment', ['comment' => $comment]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a given comment by its ID.
|
||||
* @param $id
|
||||
* @return PhotoComment
|
||||
*/
|
||||
private function loadCommentByID($id)
|
||||
{
|
||||
$comment = PhotoComment::where('id', intval($id))->first();
|
||||
if (is_null($comment))
|
||||
{
|
||||
App::abort(404);
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an e-mail notification to an album's owned that a comment has been posted/approved.
|
||||
* @param Album $album
|
||||
* @param Photo $photo
|
||||
* @param PhotoComment $comment
|
||||
*/
|
||||
private function notifyAlbumOwnerAndPoster(Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$owner = $album->user;
|
||||
|
||||
Mail::to($owner)->send(new PhotoCommentApproved($owner, $album, $photo, $comment));
|
||||
|
||||
// Also send a notification to the comment poster
|
||||
$poster = new User();
|
||||
$poster->name = $comment->authorDisplayName();
|
||||
$poster->email = $comment->authorEmail();
|
||||
|
||||
Mail::to($poster)->send(new PhotoCommentApprovedUser($poster, $album, $photo, $comment));
|
||||
|
||||
// Send notification to the parent comment owner (if this is a reply)
|
||||
if (!is_null($comment->parent_comment_id))
|
||||
{
|
||||
$parentComment = $this->loadCommentByID($comment->parent_comment_id);
|
||||
|
||||
if (is_null($parentComment))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$parentPoster = new User();
|
||||
$parentPoster->name = $parentComment->authorDisplayName();
|
||||
$parentPoster->email = $parentComment->authorEmail();
|
||||
|
||||
Mail::to($parentPoster)->send(new PhotoCommentRepliedTo($parentPoster, $album, $photo, $comment));
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ use App\Facade\Theme;
|
||||
use App\Facade\UserConfig;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\User;
|
||||
use Illuminate\Contracts\Routing\UrlGenerator;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Http\Request;
|
||||
use Laravel\Socialite\One\TwitterProvider;
|
||||
@ -29,6 +30,8 @@ class LoginController extends Controller
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
protected $generator;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login / registration.
|
||||
*
|
||||
@ -41,9 +44,19 @@ class LoginController extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(UrlGenerator $generator)
|
||||
{
|
||||
$this->middleware('guest', ['except' => 'logout']);
|
||||
$this->generator = $generator;
|
||||
}
|
||||
|
||||
public function logout(Request $request)
|
||||
{
|
||||
$this->guard()->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
protected function attemptLogin(Request $request)
|
||||
@ -88,6 +101,8 @@ class LoginController extends Controller
|
||||
*/
|
||||
public function showLoginForm(Request $request)
|
||||
{
|
||||
$request->getSession()->put('url.intended', $this->generator->previous(false));
|
||||
|
||||
return Theme::render('auth.v2_unified', [
|
||||
'active_tab' => 'login',
|
||||
'info' => $request->session()->get('info'),
|
||||
|
371
app/Http/Controllers/Gallery/PhotoCommentController.php
Normal file
@ -0,0 +1,371 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Gallery;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Facade\UserConfig;
|
||||
use App\Helpers\DbHelper;
|
||||
use App\Helpers\PermissionsHelper;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\StorePhotoCommentRequest;
|
||||
use App\Mail\ModeratePhotoComment;
|
||||
use App\Mail\PhotoCommentApproved;
|
||||
use App\Mail\PhotoCommentApprovedUser;
|
||||
use App\Permission;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class PhotoCommentController extends Controller
|
||||
{
|
||||
public function moderate(Request $request, $albumUrlAlias, $photoFilename, $commentID)
|
||||
{
|
||||
$album = null;
|
||||
|
||||
/** @var Photo $photo */
|
||||
$photo = null;
|
||||
|
||||
/** @var PhotoComment $comment */
|
||||
$comment = null;
|
||||
|
||||
if (!$this->loadAlbumPhotoComment($albumUrlAlias, $photoFilename, $commentID, $album, $photo, $comment))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!User::currentOrAnonymous()->can('moderate-comments', $photo))
|
||||
{
|
||||
App::abort(403);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$comment->isModerated())
|
||||
{
|
||||
if ($request->has('approve'))
|
||||
{
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = $this->getUser()->id;
|
||||
$comment->save();
|
||||
|
||||
$this->notifyAlbumOwnerAndPoster($album, $photo, $comment);
|
||||
$request->getSession()->flash('success', trans('gallery.photo_comment_approved_successfully'));
|
||||
}
|
||||
else if ($request->has('reject'))
|
||||
{
|
||||
$comment->rejected_at = new \DateTime();
|
||||
$comment->rejected_user_id = $this->getUser()->id;
|
||||
$comment->save();
|
||||
|
||||
$request->getSession()->flash('success', trans('gallery.photo_comment_rejected_successfully'));
|
||||
}
|
||||
}
|
||||
|
||||
return redirect($photo->url());
|
||||
}
|
||||
|
||||
public function reply(Request $request, $albumUrlAlias, $photoFilename, $commentID)
|
||||
{
|
||||
$album = null;
|
||||
|
||||
/** @var Photo $photo */
|
||||
$photo = null;
|
||||
|
||||
/** @var PhotoComment $comment */
|
||||
$comment = null;
|
||||
|
||||
if (!$this->loadAlbumPhotoComment($albumUrlAlias, $photoFilename, $commentID, $album, $photo, $comment))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!User::currentOrAnonymous()->can('post-comment', $photo))
|
||||
{
|
||||
App::abort(403);
|
||||
return null;
|
||||
}
|
||||
|
||||
return Theme::render('partials.photo_comments_reply_form', [
|
||||
'photo' => $photo,
|
||||
'reply_comment' => $comment
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(Request $request, $albumUrlAlias, $photoFilename)
|
||||
{
|
||||
$album = null;
|
||||
|
||||
/** @var Photo $photo */
|
||||
$photo = null;
|
||||
|
||||
/** @var PhotoComment $comment */
|
||||
$comment = null;
|
||||
|
||||
if (!$this->loadAlbumPhotoComment($albumUrlAlias, $photoFilename, 0, $album, $photo, $comment))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!User::currentOrAnonymous()->can('post-comment', $photo))
|
||||
{
|
||||
App::abort(403);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Validate and link the parent comment, if provided
|
||||
// We do this here so if the validation fails, we still have the parent comment available in the catch block
|
||||
$parentComment = null;
|
||||
if ($request->has('parent_comment_id'))
|
||||
{
|
||||
$parentComment = $photo->comments()->where('id', intval($request->get('parent_comment_id')))->first();
|
||||
|
||||
if (is_null($parentComment))
|
||||
{
|
||||
return redirect($photo->url());
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$this->validate($request, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'sometimes|max:255|email',
|
||||
'comment' => 'required'
|
||||
]);
|
||||
|
||||
$commentText = $this->stripDisallowedHtmlTags($request->get('comment'));
|
||||
|
||||
$comment = new PhotoComment();
|
||||
$comment->photo_id = $photo->id;
|
||||
$comment->fill($request->only(['name', 'email']));
|
||||
$comment->comment = $commentText;
|
||||
|
||||
if (!is_null($parentComment))
|
||||
{
|
||||
$comment->parent_comment_id = $parentComment->id;
|
||||
}
|
||||
|
||||
// Set the created user ID if we're logged in
|
||||
$user = $this->getUser();
|
||||
if (!is_null($user) && !$user->isAnonymous())
|
||||
{
|
||||
$comment->created_user_id = $user->id;
|
||||
}
|
||||
|
||||
// Auto-approve the comment if we're allowed to moderate comments
|
||||
$isAutoApproved = false;
|
||||
if (User::currentOrAnonymous()->can('moderate-comments', $photo))
|
||||
{
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = $user->id;
|
||||
$isAutoApproved = true;
|
||||
}
|
||||
|
||||
// Auto-approve the comment if settings allow
|
||||
if ($user->isAnonymous() && !UserConfig::get('moderate_anonymous_users'))
|
||||
{
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = null; // we don't have a user ID to set!
|
||||
$isAutoApproved = true;
|
||||
}
|
||||
else if (!$user->isAnonymous() && !UserConfig::get('moderate_known_users'))
|
||||
{
|
||||
$comment->approved_at = new \DateTime();
|
||||
$comment->approved_user_id = $user->id;
|
||||
$isAutoApproved = true;
|
||||
}
|
||||
|
||||
$comment->save();
|
||||
|
||||
// Send notification e-mails to moderators or album owner
|
||||
if (!$isAutoApproved)
|
||||
{
|
||||
$this->notifyAlbumModerators($album, $photo, $comment);
|
||||
$request->getSession()->flash('success', trans('gallery.photo_comment_posted_successfully_pending_moderation'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->notifyAlbumOwnerAndPoster($album, $photo, $comment);
|
||||
$request->getSession()->flash('success', trans('gallery.photo_comment_posted_successfully'));
|
||||
}
|
||||
|
||||
if ($request->isXmlHttpRequest())
|
||||
{
|
||||
return response()->json(['redirect_url' => $photo->url()]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect($photo->url());
|
||||
}
|
||||
}
|
||||
catch (ValidationException $e)
|
||||
{
|
||||
if (!is_null($parentComment))
|
||||
{
|
||||
return redirect()
|
||||
->to($photo->replyToCommentFormUrl($parentComment->id))
|
||||
->withErrors($e->errors())
|
||||
->withInput($request->all());
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect()
|
||||
->back()
|
||||
->withErrors($e->errors())
|
||||
->withInput($request->all());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function loadAlbumPhotoComment($albumUrlAlias, $photoFilename, $commentID, &$album, &$photo, &$comment)
|
||||
{
|
||||
$album = DbHelper::getAlbumByPath($albumUrlAlias);
|
||||
if (is_null($album))
|
||||
{
|
||||
App::abort(404);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->authorizeForUser($this->getUser(), 'view', $album);
|
||||
|
||||
$photo = PhotoController::loadPhotoByAlbumAndFilename($album, $photoFilename);
|
||||
|
||||
if (!UserConfig::get('allow_photo_comments'))
|
||||
{
|
||||
// Not allowed to post comments
|
||||
App::abort(404);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (intval($commentID > 0))
|
||||
{
|
||||
$comment = $photo->comments()->where('id', $commentID)->first();
|
||||
if (is_null($comment))
|
||||
{
|
||||
App::abort(404);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an e-mail notification to an album's moderators that a comment is available to moderate.
|
||||
* @param Album $album
|
||||
* @param Photo $photo
|
||||
* @param PhotoComment $comment
|
||||
*/
|
||||
private function notifyAlbumModerators(Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
// Get all users from the cache
|
||||
$helper = new PermissionsHelper();
|
||||
$moderators = $helper->usersWhoCan_Album($album, 'moderate-comments');
|
||||
|
||||
/** @var User $moderator */
|
||||
foreach ($moderators as $moderator)
|
||||
{
|
||||
Mail::to($moderator)->send(new ModeratePhotoComment($moderator, $album, $photo, $comment));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an e-mail notification to an album's owned that a comment has been posted/approved.
|
||||
* @param Album $album
|
||||
* @param Photo $photo
|
||||
* @param PhotoComment $comment
|
||||
*/
|
||||
private function notifyAlbumOwnerAndPoster(Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$owner = $album->user;
|
||||
|
||||
Mail::to($owner)->send(new PhotoCommentApproved($owner, $album, $photo, $comment));
|
||||
|
||||
// Also send a notification to the comment poster
|
||||
$poster = new User();
|
||||
$poster->name = $comment->authorDisplayName();
|
||||
$poster->email = $comment->authorEmail();
|
||||
|
||||
Mail::to($poster)->send(new PhotoCommentApprovedUser($poster, $album, $photo, $comment));
|
||||
|
||||
// Send notification to the parent comment owner (if this is a reply)
|
||||
if (!is_null($comment->parent_comment_id))
|
||||
{
|
||||
$parentComment = $this->loadCommentByID($comment->parent_comment_id);
|
||||
|
||||
if (is_null($parentComment))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$parentPoster = new User();
|
||||
$parentPoster->name = $parentComment->authorDisplayName();
|
||||
$parentPoster->email = $parentComment->authorEmail();
|
||||
|
||||
Mail::to($parentPoster)->send(new PhotoCommentRepliedTo($parentPoster, $album, $photo, $comment));
|
||||
}
|
||||
}
|
||||
|
||||
private function stripDisallowedHtmlTags($commentText)
|
||||
{
|
||||
$allowedHtmlTags = explode(',', UserConfig::get('photo_comments_allowed_html'));
|
||||
$allowedHtmlTagsCleaned = [];
|
||||
|
||||
foreach ($allowedHtmlTags as $tag)
|
||||
{
|
||||
$allowedHtmlTagsCleaned[] = trim($tag);
|
||||
}
|
||||
|
||||
// Match any starting HTML tags
|
||||
$regexMatchString = '/<(?!\/)([a-z]+)(?:\s.*)*>/Us';
|
||||
|
||||
$htmlTagMatches = [];
|
||||
preg_match_all($regexMatchString, $commentText, $htmlTagMatches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
|
||||
|
||||
for ($index = 0; $index < count($htmlTagMatches); $index++)
|
||||
{
|
||||
$htmlTagMatch = $htmlTagMatches[$index];
|
||||
|
||||
$htmlTag = $htmlTagMatch[1][0]; // e.g. "p" for <p>
|
||||
if (in_array($htmlTag, $allowedHtmlTagsCleaned))
|
||||
{
|
||||
// This tag is allowed - carry on
|
||||
continue;
|
||||
}
|
||||
|
||||
/* This tag is not allowed - remove it from the string */
|
||||
|
||||
// Find the closing tag
|
||||
$disallowedStringOffset = $htmlTagMatch[0][1];
|
||||
$endingTagMatches = [];
|
||||
preg_match(sprintf('/(<%1$s.*>)(.+)<\/%1$s>/Us', $htmlTag), $commentText, $endingTagMatches, 0, $disallowedStringOffset);
|
||||
|
||||
// Replace the matched string with the inner string
|
||||
$commentText = substr_replace($commentText, $endingTagMatches[2], $disallowedStringOffset, strlen($endingTagMatches[0]));
|
||||
|
||||
// Adjust the offsets for strings after the one we're processing, so the offsets match up with the string correctly
|
||||
for ($index2 = $index + 1; $index2 < count($htmlTagMatches); $index2++)
|
||||
{
|
||||
// If this string appears entirely BEFORE the next one starts, we need to subtract the entire length.
|
||||
// Otherwise, we only need to substract the length of the start tag, as the next one starts within it.
|
||||
$differenceAfterReplacement = strlen($endingTagMatches[1]);
|
||||
|
||||
if ($htmlTagMatch[0][1] + strlen($endingTagMatches[0]) < $htmlTagMatches[$index2][0][1])
|
||||
{
|
||||
$differenceAfterReplacement = strlen($endingTagMatches[0]) - strlen($endingTagMatches[2]);
|
||||
}
|
||||
|
||||
$htmlTagMatches[$index2][0][1] -= $differenceAfterReplacement;
|
||||
$htmlTagMatches[$index2][1][1] -= $differenceAfterReplacement;
|
||||
}
|
||||
}
|
||||
|
||||
return $commentText;
|
||||
}
|
||||
}
|
@ -157,7 +157,8 @@ class PhotoController extends Controller
|
||||
'is_original_allowed' => $isOriginalAllowed,
|
||||
'next_photo' => $nextPhoto,
|
||||
'photo' => $photo,
|
||||
'previous_photo' => $previousPhoto
|
||||
'previous_photo' => $previousPhoto,
|
||||
'success' => $request->getSession()->get('success')
|
||||
]);
|
||||
}
|
||||
|
||||
|
56
app/Mail/ModeratePhotoComment.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ModeratePhotoComment extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
private $album;
|
||||
private $comment;
|
||||
private $photo;
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->album = $album;
|
||||
$this->photo = $photo;
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$subject = trans('email.moderate_photo_comment_subject', ['album_name' => $this->album->name]);
|
||||
|
||||
return $this
|
||||
->subject($subject)
|
||||
->markdown(Theme::viewName('email.moderate_photo_comment'))
|
||||
->with([
|
||||
'album' => $this->album,
|
||||
'comment' => $this->comment,
|
||||
'photo' => $this->photo,
|
||||
'subject' => $subject,
|
||||
'user' => $this->user
|
||||
]);
|
||||
}
|
||||
}
|
60
app/Mail/PhotoCommentApproved.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* E-mail notification to the owner of an album that is sent when a new comment has been approved in their album.
|
||||
* @package App\Mail
|
||||
*/
|
||||
class PhotoCommentApproved extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
private $album;
|
||||
private $comment;
|
||||
private $photo;
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->album = $album;
|
||||
$this->photo = $photo;
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$subject = trans('email.photo_comment_approved_subject', ['album_name' => $this->album->name]);
|
||||
|
||||
return $this
|
||||
->subject($subject)
|
||||
->markdown(Theme::viewName('email.photo_comment_approved'))
|
||||
->with([
|
||||
'album' => $this->album,
|
||||
'comment' => $this->comment,
|
||||
'photo' => $this->photo,
|
||||
'subject' => $subject,
|
||||
'user' => $this->user
|
||||
]);
|
||||
}
|
||||
}
|
60
app/Mail/PhotoCommentApprovedUser.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* E-mail notification to the poster of a comment that is sent when it has been approved.
|
||||
* @package App\Mail
|
||||
*/
|
||||
class PhotoCommentApprovedUser extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
private $album;
|
||||
private $comment;
|
||||
private $photo;
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->album = $album;
|
||||
$this->photo = $photo;
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$subject = trans('email.photo_comment_approved_user_subject', ['album_name' => $this->album->name]);
|
||||
|
||||
return $this
|
||||
->subject($subject)
|
||||
->markdown(Theme::viewName('email.photo_comment_approved_user'))
|
||||
->with([
|
||||
'album' => $this->album,
|
||||
'comment' => $this->comment,
|
||||
'photo' => $this->photo,
|
||||
'subject' => $subject,
|
||||
'user' => $this->user
|
||||
]);
|
||||
}
|
||||
}
|
60
app/Mail/PhotoCommentRepliedTo.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\Theme;
|
||||
use App\Photo;
|
||||
use App\PhotoComment;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* E-mail notification to the poster of a comment that is sent when it has been approved.
|
||||
* @package App\Mail
|
||||
*/
|
||||
class PhotoCommentRepliedTo extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
private $album;
|
||||
private $comment;
|
||||
private $photo;
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Album $album, Photo $photo, PhotoComment $comment)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->album = $album;
|
||||
$this->photo = $photo;
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$subject = trans('email.photo_comment_replied_to_subject', ['album_name' => $this->album->name]);
|
||||
|
||||
return $this
|
||||
->subject($subject)
|
||||
->markdown(Theme::viewName('email.photo_comment_replied_to'))
|
||||
->with([
|
||||
'album' => $this->album,
|
||||
'comment' => $this->comment,
|
||||
'photo' => $this->photo,
|
||||
'subject' => $subject,
|
||||
'user' => $this->user
|
||||
]);
|
||||
}
|
||||
}
|
@ -52,6 +52,11 @@ class Photo extends Model
|
||||
return $this->belongsTo(Album::class);
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(PhotoComment::class);
|
||||
}
|
||||
|
||||
public function exifUrl()
|
||||
{
|
||||
return route('viewExifData', [
|
||||
@ -77,6 +82,32 @@ class Photo extends Model
|
||||
return $this->belongsToMany(Label::class, 'photo_labels');
|
||||
}
|
||||
|
||||
public function moderateCommentUrl($commentID = -1)
|
||||
{
|
||||
return route('moderatePhotoComment', [
|
||||
'albumUrlAlias' => $this->album->url_path,
|
||||
'photoFilename' => $this->storage_file_name,
|
||||
'commentID' => $commentID
|
||||
]);
|
||||
}
|
||||
|
||||
public function postCommentUrl()
|
||||
{
|
||||
return route('postPhotoComment', [
|
||||
'albumUrlAlias' => $this->album->url_path,
|
||||
'photoFilename' => $this->storage_file_name
|
||||
]);
|
||||
}
|
||||
|
||||
public function replyToCommentFormUrl($commentID = -1)
|
||||
{
|
||||
return route('replyPhotoComment', [
|
||||
'albumUrlAlias' => $this->album->url_path,
|
||||
'photoFilename' => $this->storage_file_name,
|
||||
'commentID' => $commentID
|
||||
]);
|
||||
}
|
||||
|
||||
public function thumbnailUrl($thumbnailName = null, $cacheBust = true)
|
||||
{
|
||||
$url = $this->album->getAlbumSource()->getUrlToPhoto($this, $thumbnailName);
|
||||
|
91
app/PhotoComment.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PhotoComment extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'comment'
|
||||
];
|
||||
|
||||
public function authorDisplayName()
|
||||
{
|
||||
return is_null($this->createdBy) ? $this->name : $this->createdBy->name;
|
||||
}
|
||||
|
||||
public function authorEmail()
|
||||
{
|
||||
return is_null($this->createdBy) ? $this->email : $this->createdBy->email;
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(PhotoComment::class, 'parent_comment_id');
|
||||
}
|
||||
|
||||
public function createdBy()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_user_id');
|
||||
}
|
||||
|
||||
public function depth()
|
||||
{
|
||||
$depth = 0;
|
||||
$current = $this;
|
||||
|
||||
while (!is_null($current->parent))
|
||||
{
|
||||
$current = $current->parent;
|
||||
$depth++;
|
||||
}
|
||||
|
||||
return $depth;
|
||||
}
|
||||
|
||||
public function isApproved()
|
||||
{
|
||||
return (!is_null($this->approved_at) && is_null($this->rejected_at));
|
||||
}
|
||||
|
||||
public function isModerated()
|
||||
{
|
||||
return (!is_null($this->approved_at) || !is_null($this->rejected_at));
|
||||
}
|
||||
|
||||
public function isRejected()
|
||||
{
|
||||
return (!is_null($this->rejected_at) && is_null($this->approved_at));
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(PhotoComment::class, 'parent_comment_id');
|
||||
}
|
||||
|
||||
public function photo()
|
||||
{
|
||||
return $this->belongsTo(Photo::class);
|
||||
}
|
||||
|
||||
public function textAsHtml()
|
||||
{
|
||||
$start = '<p>';
|
||||
$end = '</p>';
|
||||
$isHtml = (
|
||||
strlen($this->comment) > (strlen($start) + strlen($end)) && // text contains both our start + end string
|
||||
strtolower(substr($this->comment, 0, strlen($start))) == strtolower($start) && // text starts with our start string
|
||||
strtolower(substr($this->comment, strlen($this->comment) - strlen($end))) == strtolower($end) // text ends with our end string
|
||||
);
|
||||
|
||||
return $isHtml ? $this->comment : sprintf('<p>%s</p>', $this->comment);
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Album;
|
||||
use App\Facade\UserConfig;
|
||||
use App\Group;
|
||||
use App\Helpers\PermissionsHelper;
|
||||
use App\Permission;
|
||||
@ -93,6 +94,34 @@ class AlbumPolicy
|
||||
return $this->userHasPermission($user, $album, 'manipulate-photos');
|
||||
}
|
||||
|
||||
public function moderateComments(User $user, Album $album)
|
||||
{
|
||||
if ($user->id == $album->user_id)
|
||||
{
|
||||
// The album's owner and can do everything
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->userHasPermission($user, $album, 'moderate-comments');
|
||||
}
|
||||
|
||||
public function postComment(User $user, Album $album)
|
||||
{
|
||||
if ($user->id == $album->user_id)
|
||||
{
|
||||
// The album's owner and can do everything
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't allow comments to be posted if anonymous user, and anonymous comments disabled
|
||||
if ($user->isAnonymous() && !UserConfig::get('allow_photo_comments_anonymous'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->userHasPermission($user, $album, 'post-comment');
|
||||
}
|
||||
|
||||
public function uploadPhotos(User $user, Album $album)
|
||||
{
|
||||
if ($user->id == $album->user_id)
|
||||
|
@ -61,4 +61,26 @@ class PhotoPolicy
|
||||
|
||||
return $user->can('manipulate-photos', $photo->album);
|
||||
}
|
||||
|
||||
public function moderateComments(User $user, Photo $photo)
|
||||
{
|
||||
if ($user->id == $photo->user_id)
|
||||
{
|
||||
// The photo's owner can do everything
|
||||
return true;
|
||||
}
|
||||
|
||||
return $user->can('moderate-comments', $photo->album);
|
||||
}
|
||||
|
||||
public function postComment(User $user, Photo $photo)
|
||||
{
|
||||
if ($user->id == $photo->user_id)
|
||||
{
|
||||
// The photo's owner can do everything
|
||||
return true;
|
||||
}
|
||||
|
||||
return $user->can('post-comment', $photo->album);
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,10 @@ class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
return $this->userHasAdminPermission($user, 'manage-albums');
|
||||
});
|
||||
Gate::define('admin:manage-comments', function ($user)
|
||||
{
|
||||
return $this->userHasAdminPermission($user, 'manage-comments');
|
||||
});
|
||||
Gate::define('admin:manage-groups', function ($user)
|
||||
{
|
||||
return $this->userHasAdminPermission($user, 'manage-groups');
|
||||
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePhotoCommentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('photo_comments', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('photo_id');
|
||||
$table->string('name');
|
||||
$table->string('email');
|
||||
$table->text('comment');
|
||||
$table->unsignedInteger('created_user_id')->nullable(true);
|
||||
$table->unsignedInteger('approved_user_id')->nullable(true);
|
||||
$table->dateTime('approved_at')->nullable(true);
|
||||
$table->unsignedBigInteger('parent_comment_id')->nullable(true);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('photo_id')
|
||||
->references('id')->on('photos')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('created_user_id')
|
||||
->references('id')->on('users')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('approved_user_id')
|
||||
->references('id')->on('users')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('parent_comment_id')
|
||||
->references('id')->on('photo_comments')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('photo_comments');
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCommentRejectedColumns extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('photo_comments', function (Blueprint $table) {
|
||||
$table->unsignedInteger('rejected_user_id')->nullable(true);
|
||||
$table->dateTime('rejected_at')->nullable(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('photo_comments', function (Blueprint $table) {
|
||||
$table->dropColumn('rejected_user_id');
|
||||
$table->dropColumn('rejected_at');
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAlbumDefaultGroupPermissionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('album_default_group_permissions', function (Blueprint $table) {
|
||||
$table->unsignedInteger('group_id');
|
||||
$table->unsignedInteger('permission_id');
|
||||
|
||||
$table->foreign('group_id')
|
||||
->references('id')->on('groups')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('permission_id')
|
||||
->references('id')->on('permissions')
|
||||
->onDelete('no action');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('album_default_group_permissions');
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAlbumDefaultUserPermissionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('album_default_user_permissions', function (Blueprint $table) {
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('permission_id');
|
||||
|
||||
$table->foreign('user_id')
|
||||
->references('id')->on('users')
|
||||
->onDelete('cascade');
|
||||
$table->foreign('permission_id')
|
||||
->references('id')->on('permissions')
|
||||
->onDelete('no action');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('album_default_user_permissions');
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAlbumDefaultAnonymousPermissionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('album_default_anonymous_permissions', function (Blueprint $table) {
|
||||
$table->unsignedInteger('permission_id');
|
||||
|
||||
$table->foreign('permission_id')
|
||||
->references('id')->on('permissions')
|
||||
->onDelete('no action');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('album_default_anonymous_permissions');
|
||||
}
|
||||
}
|
@ -72,6 +72,14 @@ class PermissionsSeeder extends Seeder
|
||||
'is_default' => false,
|
||||
'sort_order' => 0
|
||||
]);
|
||||
|
||||
// admin:manage-comments = controls if photo comments can be managed
|
||||
DatabaseSeeder::createOrUpdate('permissions', [
|
||||
'section' => 'admin',
|
||||
'description' => 'manage-comments',
|
||||
'is_default' => false,
|
||||
'sort_order' => 0
|
||||
]);
|
||||
}
|
||||
|
||||
private function seedAlbumPermissions()
|
||||
@ -139,5 +147,21 @@ class PermissionsSeeder extends Seeder
|
||||
'is_default' => false,
|
||||
'sort_order' => 60
|
||||
]);
|
||||
|
||||
// album:moderate-comments = moderate comments posted on photos
|
||||
DatabaseSeeder::createOrUpdate('permissions', [
|
||||
'section' => 'album',
|
||||
'description' => 'moderate-comments',
|
||||
'is_default' => false,
|
||||
'sort_order' => 70
|
||||
]);
|
||||
|
||||
// album:moderate-comments = moderate comments posted on photos
|
||||
DatabaseSeeder::createOrUpdate('permissions', [
|
||||
'section' => 'album',
|
||||
'description' => 'post-comment',
|
||||
'is_default' => false,
|
||||
'sort_order' => 80
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +100,10 @@
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.photo-comment .card-subtitle {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.stats-table .icon-col {
|
||||
font-size: 1.4em;
|
||||
width: 20%;
|
||||
|
2
public/css/blue-twilight.min.css
vendored
@ -1,4 +1,4 @@
|
||||
.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.meta-label,.meta-value{vertical-align:middle !important}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}.text-red{color:red}[v-cloak]{display:none}.activity-grid{font-size:smaller}.activity-grid th,.activity-grid td{padding:5px !important;text-align:center}.activity-grid td{color:#fff;height:20px}.activity-grid .has-activity{background-color:#1e90ff}.activity-grid .invalid-date{background-color:#e5e5e5}.activity-grid .no-activity{background-color:#fff}.activity-grid th:first-child,.activity-grid td:first-child{border-left:1px solid #dee2e6}.activity-grid th,.activity-grid td{border-right:1px solid #dee2e6}.activity-grid tr:last-child td{border-bottom:1px solid #dee2e6}.activity-grid .border-spacer-element{border-right-width:0;padding:0 !important;width:1px}.album-slideshow-container #image-preview{height:600px;max-width:100%;width:800px}.album-slideshow-container #image-preview img{max-width:100%}.album-slideshow-container .thumbnails{overflow-x:scroll;overflow-y:hidden;white-space:nowrap;width:auto}.stats-table .icon-col{font-size:1.4em;width:20%;vertical-align:middle}.stats-table .stat-col{font-size:1.8em;font-weight:bold;width:40%}.stats-table .text-col{font-size:1.2em;vertical-align:middle;width:40%}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*!
|
||||
.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.meta-label,.meta-value{vertical-align:middle !important}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}.text-red{color:red}[v-cloak]{display:none}.activity-grid{font-size:smaller}.activity-grid th,.activity-grid td{padding:5px !important;text-align:center}.activity-grid td{color:#fff;height:20px}.activity-grid .has-activity{background-color:#1e90ff}.activity-grid .invalid-date{background-color:#e5e5e5}.activity-grid .no-activity{background-color:#fff}.activity-grid th:first-child,.activity-grid td:first-child{border-left:1px solid #dee2e6}.activity-grid th,.activity-grid td{border-right:1px solid #dee2e6}.activity-grid tr:last-child td{border-bottom:1px solid #dee2e6}.activity-grid .border-spacer-element{border-right-width:0;padding:0 !important;width:1px}.album-slideshow-container #image-preview{height:600px;max-width:100%;width:800px}.album-slideshow-container #image-preview img{max-width:100%}.album-slideshow-container .thumbnails{overflow-x:scroll;overflow-y:hidden;white-space:nowrap;width:auto}.photo-comment .card-subtitle{font-size:smaller}.stats-table .icon-col{font-size:1.4em;width:20%;vertical-align:middle}.stats-table .stat-col{font-size:1.8em;font-weight:bold;width:40%}.stats-table .text-col{font-size:1.2em;vertical-align:middle;width:40%}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*!
|
||||
* Bootstrap v4.1.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2018 The Bootstrap Authors
|
||||
* Copyright 2011-2018 Twitter, Inc.
|
||||
|
@ -41534,6 +41534,82 @@ module.exports = function(Chart) {
|
||||
|
||||
},{"25":25,"45":45,"6":6}]},{},[7])(7)
|
||||
});
|
||||
/**
|
||||
* This model is used by gallery/photo.blade.php, to handle comments and individual photo actions.
|
||||
* @constructor
|
||||
*/
|
||||
function PhotoViewModel(urls) {
|
||||
this.el = '#photo-app';
|
||||
|
||||
this.data = {
|
||||
is_reply_form_loading: false,
|
||||
reply_comment_id: 0
|
||||
};
|
||||
|
||||
this.computed = {
|
||||
replyFormStyle: function()
|
||||
{
|
||||
return {
|
||||
'display': this.is_reply_form_loading ? 'none' : 'block'
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
this.methods = {
|
||||
init: function() {
|
||||
var self = this;
|
||||
|
||||
// Load the right comment reply form
|
||||
$('#comment-reply-modal').on('show.bs.modal', function (event) {
|
||||
var url = urls.reply_comment_form.replace(/-1$/, self.reply_comment_id);
|
||||
$.get(url, function(result)
|
||||
{
|
||||
$('#comment-reply-form-content').html(result);
|
||||
initTinyMce('#comment-text-reply');
|
||||
self.is_reply_form_loading = false;
|
||||
});
|
||||
});
|
||||
|
||||
$('#comment-reply-modal').on('hide.bs.modal', function (event) {
|
||||
tinymce.remove('#comment-text-reply');
|
||||
});
|
||||
},
|
||||
postCommentReply: function() {
|
||||
var form = $('form', '#comment-reply-form-content');
|
||||
var formUrl = $(form).attr('action');
|
||||
|
||||
// Seems like the TinyMCE editor in the BS modal does not persist back to the textarea correctly - so do
|
||||
// this manually (bit of a hack!)
|
||||
$('#comment-text-reply', form).html(tinymce.get('comment-text-reply').getContent());
|
||||
|
||||
var formData = form.serialize();
|
||||
|
||||
$.post(formUrl, formData, function(result)
|
||||
{
|
||||
if (result.redirect_url)
|
||||
{
|
||||
window.location = result.redirect_url;
|
||||
}
|
||||
else
|
||||
{
|
||||
tinymce.remove('#comment-text-reply');
|
||||
$('#comment-reply-form-content').html(result);
|
||||
initTinyMce('#comment-text-reply');
|
||||
}
|
||||
});
|
||||
},
|
||||
replyToComment: function(e) {
|
||||
var replyButton = $(e.target).closest('.photo-comment');
|
||||
this.reply_comment_id = replyButton.data('comment-id');
|
||||
|
||||
this.is_reply_form_loading = true;
|
||||
$('#comment-reply-modal').modal('show');
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
function StorageLocationViewModel()
|
||||
{
|
||||
this.el = '#storage-options';
|
||||
|
2
public/js/blue-twilight.min.js
vendored
504
public/tinymce/LICENSE.TXT
Executable 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!
|
||||
|
||||
|
1000
public/tinymce/changelog.txt
Executable file
1
public/tinymce/js/tinymce/jquery.tinymce.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;var v=function(){return d.tinymce};p.fn.tinymce=function(o){var e,t,i,l=this,r="";if(!l.length)return l;if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");var n=function(){var a=[],c=0;u||(m(),u=!0),l.each(function(e,t){var n,i=t.id,r=o.oninit;i||(t.id=i=v().DOM.uniqueId()),v().get(i)||(n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),t.apply(e||v(),a))}))}),p.each(a,function(e,t){t.render()})};if(d.tinymce||c||!(e=o.script_url))1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")),-1!=e.indexOf(".min")&&(r=".min"),d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},-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||""),d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))};n("langs/"+i+".js"),n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),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,o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l},p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}});var m=function(){var r=function(e){"remove"===e&&this.each(function(e,t){var n=l(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()})},o=function(i){var e,t=this;if(null!=i)r.call(t),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()},l=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},u=function(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))},s={};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(!u(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=l(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),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 u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),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,p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(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;var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();
|
3
public/tinymce/js/tinymce/langs/readme.md
Executable 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/
|
504
public/tinymce/js/tinymce/license.txt
Executable 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!
|
||||
|
||||
|
1
public/tinymce/js/tinymce/plugins/advlist/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},o=function(n){n.addCommand("ApplyUnorderedListStyle",function(t,e){s(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){s(n,"OL",e["list-style-type"])})},e=function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]},n=function(t){var e=t.getParam("advlist_bullet_styles","default,circle,disc,square");return e?e.split(/[ ,]/):[]},u=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},c=function(r){return function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(n=t,(e=r).$.contains(e.getBody(),n));var e,n}},d=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return t.dom.getStyle(e,"listStyleType")||""},p=function(t){return a.map(t,function(t){return{text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"===t?"":t}})},f=function(i,l){return function(t){var o=t.control;i.on("NodeChange",function(t){var e=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(t.parents,u),n=-1!==e?t.parents.slice(0,e):t.parents,r=a.grep(n,c(i));o.active(0<r.length&&r[0].nodeName===l)})}},m=function(e,t,n,r,o,i){var l;e.addButton(t,{active:!1,type:"splitbutton",tooltip:n,menu:p(i),onPostRender:f(e,o),onshow:(l=e,function(t){var e=d(l);t.control.items().each(function(t){t.active(t.settings.data===e)})}),onselect:function(t){s(e,o,t.control.settings.data)},onclick:function(){e.execCommand(r)}})},r=function(t,e,n,r,o,i){var l,a,s,u,c;0<i.length?m(t,e,n,r,o,i):(a=e,s=n,u=r,c=o,(l=t).addButton(a,{active:!1,type:"button",tooltip:s,onPostRender:f(l,c),onclick:function(){l.execCommand(u)}}))},i=function(t){r(t,"numlist","Numbered list","InsertOrderedList","OL",e(t)),r(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))};t.add("advlist",function(t){var e,n,r;n="lists",r=(e=t).settings.plugins?e.settings.plugins:"",-1!==a.inArray(r.split(/[ ,]/),n)&&(i(t),o(t))})}();
|
1
public/tinymce/js/tinymce/plugins/anchor/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=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})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(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}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();
|
1
public/tinymce/js/tinymce/plugins/autolink/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.Env"),m=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},y=function(e){return e.getParam("default_link_target","")},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;n<t&&(t=n)}return t},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},p=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},r=function(e,t,n){var i,o,r,a,f,s,d,l,c,u,g=m(e),h=y(e);if("A"!==e.selection.getNode().tagName){if((i=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,k(i,l,c),p(i,l,c),i.endOffset<5)return;o=i.endOffset,a=l}else{if(3!==(a=i.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(k(i,a,0),p(i,a,a.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-t}for(r=o;k(i,a,2<=o?o-2:0),p(i,a,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);var C;(C=i.toString())===n||" "===C||160===C.charCodeAt(0)?(k(i,a,o),p(i,a,r),o+=1):(0===i.startOffset?k(i,a,0):k(i,a,o),p(i,a,r)),"."===(s=i.toString()).charAt(s.length-1)&&p(i,a,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]),f=e.selection.getBookmark(),e.selection.setRng(i),e.execCommand("createlink",!1,d[1]+d[2]),h&&e.dom.setAttrib(e.selection.getNode(),"target",h),e.selection.moveToBookmark(f),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),i.ie?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};e.add("autolink",function(e){t(e)})}();
|
1
public/tinymce/js/tinymce/plugins/autoresize/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},v=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},o=function(t){return t.getParam("autoresize_overflow_padding",1)},a=function(t){return t.getParam("autoresize_bottom_margin",50)},n=function(t){return t.getParam("autoresize_on_init",!0)},u=function(t,e,n,i,o){r.setEditorTimeout(t,function(){_(t,e),n--?u(t,e,n,i,o):o&&o()},i)},S=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},_=function(t,e){var n,i,o,r,a,u,s,l,g,c,f,d=t.dom;if(i=t.getDoc())if((m=t).plugins.fullscreen&&m.plugins.fullscreen.isFullscreen())S(t,!0);else{var m;o=i.body,r=h(t),u=d.getStyle(o,"margin-top",!0),s=d.getStyle(o,"margin-bottom",!0),l=d.getStyle(o,"padding-top",!0),g=d.getStyle(o,"padding-bottom",!0),c=d.getStyle(o,"border-top-width",!0),f=d.getStyle(o,"border-bottom-width",!0),a=o.offsetHeight+parseInt(u,10)+parseInt(s,10)+parseInt(l,10)+parseInt(g,10)+parseInt(c,10)+parseInt(f,10),(isNaN(a)||a<=0)&&(a=y.ie?o.scrollHeight:y.webkit&&0===o.clientHeight?0:o.offsetHeight),a>h(t)&&(r=a);var p=v(t);p&&p<a?(r=p,S(t,!0)):S(t,!1),r!==e.get()&&(n=r-e.get(),d.setStyle(t.iframeElement,"height",r+"px"),e.set(r),y.webkit&&n<0&&_(t,e))}},s={setup:function(i,e){i.on("init",function(){var t,e,n=i.dom;t=o(i),e=a(i),!1!==t&&n.setStyles(i.getBody(),{paddingLeft:t,paddingRight:t}),!1!==e&&n.setStyles(i.getBody(),{paddingBottom:e})}),i.on("nodechange setcontent keyup FullscreenStateChanged",function(t){_(i,e)}),n(i)&&i.on("init",function(){u(i,e,20,100,function(){u(i,e,5,1e3)})})},resize:_},l=function(t,e){t.addCommand("mceAutoResize",function(){s.resize(t,e)})};t.add("autoresize",function(t){if(!t.inline){var e=i(0);l(t,e),s.setup(t,e)}})}();
|
1
public/tinymce/js/tinymce/plugins/autosave/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var n=function(t){var e=t,r=function(){return e};return{get:r,set:function(t){e=t},clone:function(){return n(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(t){return t.fire("RestoreDraft")},i=function(t){return t.fire("StoreDraft")},s=function(t){return t.fire("RemoveDraft")},e=function(t,e){return((t=/^(\d+)([ms]?)$/.exec(""+(t||e)))[2]?{s:1e3,m:6e4}[t[2]]:1)*parseInt(t,10)},u=function(t){return t.getParam("autosave_ask_before_unload",!0)},f=function(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,document.location.pathname)).replace(/\{query\}/g,document.location.search)).replace(/\{hash\}/g,document.location.hash)).replace(/\{id\}/g,t.id)},c=function(t){return e(t.settings.autosave_interval,"30s")},l=function(t){return e(t.settings.autosave_retention,"20m")},m=function(t,e){var r=t.settings.forced_root_block;return""===(e=o.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+r+"[^>]*>((\xa0| |[ \t]|<br[^>]*>)+?|)</"+r+">|<br>$","i").test(e)},v=function(t){var e=parseInt(a.getItem(f(t)+"time"),10)||0;return!((new Date).getTime()-e>l(t)&&(d(t,!1),1))},d=function(t,e){var r=f(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&s(t)},D=function(t){var e=f(t);!m(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),i(t))},g=function(t){var e=f(t);v(t)&&(t.setContent(a.getItem(e+"draft"),{format:"raw"}),r(t))},y={isEmpty:m,hasDraft:v,removeDraft:d,storeDraft:D,restoreDraft:g,startStoreDraft:function(t,e){var r=c(t);e.get()||(setInterval(function(){t.removed||D(t)},r),e.set(!0))},restoreLastDraft:function(t){t.undoManager.transact(function(){g(t),d(t)}),t.focus()}},p=function(e,r){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r].concat(t))}},h=function(t){return{hasDraft:p(y.hasDraft,t),storeDraft:p(y.storeDraft,t),restoreDraft:p(y.restoreDraft,t),removeDraft:p(y.removeDraft,t),isEmpty:p(y.isEmpty,t)}},_=tinymce.util.Tools.resolve("tinymce.EditorManager");_._beforeUnloadHandler=function(){var e;return o.each(_.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e};var b=function(t){window.onbeforeunload=_._beforeUnloadHandler},I=function(r,n){return function(t){var e=t.control;e.disabled(!y.hasDraft(r)),r.on("StoreDraft RestoreDraft RemoveDraft",function(){e.disabled(!y.hasDraft(r))}),y.startStoreDraft(r,n)}},w=function(t,e){t.addButton("restoredraft",{title:"Restore last draft",onclick:function(){y.restoreLastDraft(t)},onPostRender:I(t,e)}),t.addMenuItem("restoredraft",{text:"Restore last draft",onclick:function(){y.restoreLastDraft(t)},onPostRender:I(t,e),context:"file"})};t.add("autosave",function(t){var e=n(!1);return b(t),w(t,e),h(t)})}();
|
1
public/tinymce/js/tinymce/plugins/bbcode/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(e){e=t.trim(e);var o=function(o,t){e=e.replace(o,t)};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(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),e},i=function(e){e=t.trim(e);var o=function(o,t){e=e.replace(o,t)};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> '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),e};o.add("bbcode",function(){return{init: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=e(o.content))})}}})}();
|
1
public/tinymce/js/tinymce/plugins/charmap/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/code/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();
|
138
public/tinymce/js/tinymce/plugins/codesample/css/prism.css
Executable file
@ -0,0 +1,138 @@
|
||||
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre) > code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #a67f59;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
1
public/tinymce/js/tinymce/plugins/codesample/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Color"),a=function(e,n){e.find("#preview")[0].getEl().style.background=n},o=function(e,n){var i=l(n),t=i.toRgb();e.fromJSON({r:t.r,g:t.g,b:t.b,hex:i.toHex().substr(1)}),a(e,i.toHex())},t=function(e,n,i){var t=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:i,onchange:function(){var e=this.rgb();t&&(t.find("#r").value(e.r),t.find("#g").value(e.g),t.find("#b").value(e.b),t.find("#hex").value(this.value().substr(1)),a(t,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=t.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return o(t,n="#"+n),void i.value(n);n={r:t.find("#r").value(),g:t.find("#g").value(),b:t.find("#b").value()},i.value(n),o(t,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+t.toJSON().hex)}});o(t,i)};e.add("colorpicker",function(i){i.settings.color_picker_callback||(i.settings.color_picker_callback=function(e,n){t(i,e,n)})})}();
|
1
public/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var o=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return o(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t){return{isContextMenuVisible:function(){return t.get()}}},r=function(t){return t.settings.contextmenu_never_use_native},u=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=function(t){return l.DOM.select(t.settings.ui_container)[0]},a=function(t,n){return{x:t,y:n}},f=function(t,n,e){return a(t.x+n,t.y+e)},m=function(t,n){if(t&&"static"!==l.DOM.getStyle(t,"position",!0)){var e=l.DOM.getPos(t),o=e.x-t.scrollLeft,i=e.y-t.scrollTop;return f(n,-o,-i)}return f(n,0,0)},c=function(t,n){if(t.inline)return m(s(t),a((u=n).pageX,u.pageY));var e,o,i,r,u,c=(e=t.getContentAreaContainer(),o=a((r=n).clientX,r.clientY),i=l.DOM.getPos(e),f(o,i.x,i.y));return m(s(t),c)},g=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=function(t,n,e,o){null===o.get()?o.set(function(e,n){var t,o,i=[];o=u(e),v.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"===t&&(n={text:t}),n&&(n.shortcut="",i.push(n))});for(var r=0;r<i.length;r++)"|"===i[r].text&&(0!==r&&r!==i.length-1||i.splice(r,1));return(t=g.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"})).uiContainer=s(e),t.renderTo(s(e)),t.on("hide",function(t){t.control===this&&n.set(!1)}),e.on("remove",function(){t.remove(),t=null}),t}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},x=function(e,o,i){e.on("contextmenu",function(t){var n;n=e,(!t.ctrlKey||r(n))&&(t.preventDefault(),y(e,c(e,t),o,i))})};t.add("contextmenu",function(t){var n=o(null),e=o(!1);return x(t,e,n),i(e)})}();
|
1
public/tinymce/js/tinymce/plugins/directionality/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();
|
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-cool.gif
Executable file
After Width: | Height: | Size: 354 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-cry.gif
Executable file
After Width: | Height: | Size: 329 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif
Executable file
After Width: | Height: | Size: 331 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif
Executable file
After Width: | Height: | Size: 342 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-frown.gif
Executable file
After Width: | Height: | Size: 340 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-innocent.gif
Executable file
After Width: | Height: | Size: 336 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-kiss.gif
Executable file
After Width: | Height: | Size: 338 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-laughing.gif
Executable file
After Width: | Height: | Size: 343 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif
Executable file
After Width: | Height: | Size: 321 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-sealed.gif
Executable file
After Width: | Height: | Size: 323 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-smile.gif
Executable file
After Width: | Height: | Size: 344 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-surprised.gif
Executable file
After Width: | Height: | Size: 338 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif
Executable file
After Width: | Height: | Size: 328 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-undecided.gif
Executable file
After Width: | Height: | Size: 337 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-wink.gif
Executable file
After Width: | Height: | Size: 350 B |
BIN
public/tinymce/js/tinymce/plugins/emoticons/img/smiley-yell.gif
Executable file
After Width: | Height: | Size: 336 B |
1
public/tinymce/js/tinymce/plugins/emoticons/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]],i=function(i){var o;return o='<table role="list" class="mce-grid">',e.each(n,function(t){o+="<tr>",e.each(t,function(t){var e=i+"/img/smiley-"+t+".gif";o+='<td><a href="#" data-mce-url="'+e+'" data-mce-alt="'+t+'" tabindex="-1" role="option" aria-label="'+t+'"><img src="'+e+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),o+="</tr>"}),o+="</table>"},o=function(a,t){var e=i(t);a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:e,onclick:function(t){var e,i,o,n=a.dom.getParent(t.target,"a");n&&(e=a,i=n.getAttribute("data-mce-url"),o=n.getAttribute("data-mce-alt"),e.insertContent(e.dom.createHTML("img",{src:i,alt:o})),this.hide())}},tooltip:"Emoticons"})};t.add("emoticons",function(t,e){o(t,e)})}();
|
1
public/tinymce/js/tinymce/plugins/fullpage/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=function(e,n){e.fire("FullscreenStateChanged",{state:n})},g=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=document.body,u=document.documentElement,d=n.get(),a=function(){var e,n,t,i;g.setStyle(l,"height",(t=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){g.unbind(window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),g.removeClass(s,"mce-fullscreen"),g.removeClass(u,"mce-fullscreen"),g.removeClass(r,"mce-fullscreen"),o=d.scrollPos,window.scrollTo(o.x,o.y),g.unbind(window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),m(e,!1);else{var f={scrollPos:(c=g.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",g.addClass(s,"mce-fullscreen"),g.addClass(u,"mce-fullscreen"),g.addClass(r,"mce-fullscreen"),g.bind(window,"resize",a),e.on("remove",h),a(),n.set(f),m(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}();
|
BIN
public/tinymce/js/tinymce/plugins/help/img/logo.png
Executable file
After Width: | Height: | Size: 13 KiB |
1
public/tinymce/js/tinymce/plugins/help/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/hr/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();
|
1
public/tinymce/js/tinymce/plugins/image/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/imagetools/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/importcss/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.EditorManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(e){return e.getParam("importcss_merge_classes")},n=function(e){return e.getParam("importcss_exclusive")},_=function(e){return e.getParam("importcss_selector_converter")},r=function(e){return e.getParam("importcss_selector_filter")},i=function(e){return e.getParam("importcss_groups")},u=function(e){return e.getParam("importcss_append")},l=function(e){return e.getParam("importcss_file_filter")},a=function(t){return"string"==typeof t?function(e){return-1!==e.indexOf(t)}:t instanceof RegExp?function(e){return t.test(e)}:t},f=function(f,e,m){var g=[],n={};function p(e,t){var n,r,i,c=e.href;if(r=c,i=h.cacheSuffix,"string"==typeof r&&(r=r.replace("?"+i,"").replace("&"+i,"")),(c=r)&&m(c,t)&&(o=c,u=(s=f).settings,!(l=!1!==u.skin&&(u.skin||"lightgray"))||o!==(u.skin_url?s.documentBaseURI.toAbsolute(u.skin_url):v.baseURL+"/skins/"+l)+"/content"+(s.inline?".inline":"")+".min.css")){var s,o,u,l;y.each(e.imports,function(e){p(e,!0)});try{n=e.cssRules||e.rules}catch(a){}y.each(n,function(e){e.styleSheet?p(e.styleSheet,!0):e.selectorText&&y.each(e.selectorText.split(","),function(e){g.push(y.trim(e))})})}}y.each(f.contentCSS,function(e){n[e]=!0}),m||(m=function(e,t){return t||n[e]});try{y.each(e.styleSheets,function(e){p(e)})}catch(t){}return g},x=function(e,t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var i=r[1],c=r[2].substr(1).split(".").join(" "),s=y.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[i]?n.block=i:e.schema.getBlockElements()[i]||s[i.toLowerCase()]?n.selector=i:n.inline=i):r[2]&&(n={inline:"span",title:t.substr(1),classes:c}),!1!==o(e)?n.classes=c:n.attributes={"class":c},n}},T=function(e,t){return null===t||!1!==n(e)},c=x,t=function(h){h.on("renderFormatsMenu",function(e){var t,p={},c=a(r(h)),v=e.control,s=(t=i(h),y.map(t,function(e){return y.extend({},e,{original:e,selectors:{},filter:a(e.filter),item:{text:e.title,menu:[]}})})),o=function(e,t){if(f=e,g=p,!(T(h,m=t)?f in g:f in m.selectors)){u=e,a=p,T(h,l=t)?a[u]=!0:l.selectors[u]=!0;var n=(c=(i=h).plugins.importcss,s=e,((o=t)&&o.selector_converter?o.selector_converter:_(i)?_(i):function(){return x(i,s)}).call(c,s,o));if(n){var r=n.name||d.DOM.uniqueId();return h.formatter.register(r,n),y.extend({},v.settings.itemDefaults,{text:n.title,format:r})}}var i,c,s,o,u,l,a,f,m,g;return null};u(h)||v.items().remove(),y.each(f(h,e.doc||h.getDoc(),a(l(h))),function(n){if(-1===n.indexOf(".mce-")&&(!c||c(n))){var e=(r=s,i=n,y.grep(r,function(e){return!e.filter||e.filter(i)}));if(0<e.length)y.each(e,function(e){var t=o(n,e);t&&e.item.menu.push(t)});else{var t=o(n,null);t&&v.add(t)}}var r,i}),y.each(s,function(e){0<e.item.menu.length&&v.add(e.item)}),e.control.renderNew()})},s=function(t){return{convertSelectorToFormat:function(e){return c(t,e)}}};e.add("importcss",function(e){return t(e),s(e)})}();
|
1
public/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},a=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},i=n,o=a,u=function(e){var t=a(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},c="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),d="January February March April May June July August September October November December".split(" "),p=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=function(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",p(n.getMonth()+1,2))).replace("%d",p(n.getDate(),2))).replace("%H",""+p(n.getHours(),2))).replace("%M",""+p(n.getMinutes(),2))).replace("%S",""+p(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(d[n.getMonth()]))).replace("%b",""+e.translate(s[n.getMonth()]))).replace("%A",""+e.translate(l[n.getDay()]))).replace("%a",""+e.translate(c[n.getDay()]))).replace("%%","%")},g=function(e,t){if(m(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,l=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(l,o),i.dom.remove(o),i.selection.select(l,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,c,l},y=f,M=function(e){e.addCommand("mceInsertDate",function(){g(e,t(e))}),e.addCommand("mceInsertTime",function(){g(e,i(e))})},v=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(t,n){var r,a,e,i=(a=n,e=o(r=t),v.map(e,function(e){return{text:y(r,e),onclick:function(){a.set(e),g(r,e)}}}));t.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:i,onclick:function(){var e=n.get();g(t,e||u(t))}}),t.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:i,context:"insert"})};e.add("insertdatetime",function(e){var t=r(null);M(e),S(e,t)})}();
|
1
public/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(a){a.settings.inline_styles=!1,a.on("init",function(){var e,t,n,i;e=a,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",n=o.explode(e.settings.font_size_style_values),i=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",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(e){return o.inArray(n,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),o.each("b,i,u,strike".split(","),function(e){i.addValidElements(e+"[*]")}),i.getElementRule("font")||i.addValidElements("font[face|size|color|style]"),o.each(t.split(","),function(e){var t=i.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})},n=function(i){i.addButton("fontsizeselect",function(){var o=[],e=i.settings.fontsizeFormats||"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7";return i.$.each(e.split(" "),function(e,t){var n=t,i=t,a=t.split("=");1<a.length&&(n=a[0],i=a[1]),o.push({text:n,value:i})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:o,fixedWidth:!0,onPostRender:function(){var t=this;i.on("NodeChange",function(){var e;(e=i.dom.getParent(i.selection.getNode(),"font"))?t.value(e.size):t.value("")})},onclick:function(e){e.control.settings.value&&i.execCommand("FontSize",!1,e.control.settings.value)}}}),i.addButton("fontselect",function(){var n=[],e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(i.settings.font_formats||"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");return i.$.each(e,function(e,t){n.push({text:{raw:t[0]},value:t[1],textStyle:-1===t[1].indexOf("dings")?"font-family:"+t[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:function(){var t=this;i.on("NodeChange",function(){var e;(e=i.dom.getParent(i.selection.getNode(),"font"))?t.value(e.face):t.value("")})},onselect:function(e){e.control.settings.value&&i.execCommand("FontName",!1,e.control.settings.value)}}})};e.add("legacyoutput",function(e){t(e),n(e)})}();
|
1
public/tinymce/js/tinymce/plugins/link/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/lists/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/media/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){var t,i=(t=n).plugins.visualchars&&t.plugins.visualchars.isEnabled()?'<span class="mce-nbsp"> </span>':" ";n.insertContent(function(n,e){for(var t="",i=0;i<e;i++)t+=n;return t}(i,e)),n.dom.setAttrib(n.dom.select("span.mce-nbsp"),"data-mce-bogus","1")},e=function(n){n.addCommand("mceNonBreaking",function(){i(n,1)})},o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},t=function(e){var t=a(e);0<t&&e.on("keydown",function(n){if(n.keyCode===o.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),i(e,t)}})},r=function(n){n.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),n.addMenuItem("nonbreaking",{icon:"nonbreaking",text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"})};n.add("nonbreaking",function(n){e(n),r(n),t(n)})}();
|
1
public/tinymce/js/tinymce/plugins/noneditable/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},u=function(t){return t.getParam("noneditable_editable_class","mceEditable")},f=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},s=function(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}},d=function(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&&-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>"}},n=function(n){var t,e,r="contenteditable";t=" "+c.trim(u(n))+" ",e=" "+c.trim(l(n))+" ";var a=s(t),i=s(e),o=f(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],d(t,a,l(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))})})};t.add("noneditable",function(t){n(t)})}();
|
1
public/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},t=function(){return"mce-pagebreak"},r=function(){return'<img src="'+a.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'},c=function(c){var o=n(c),a=new RegExp(o.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");c.on("BeforeSetContent",function(e){e.content=e.content.replace(a,r())}),c.on("PreInit",function(){c.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(c.schema.getBlockElements()[r.name]&&i(c)){r.type=3,r.value=o,r.raw=!0,a.remove();continue}a.type=3,a.value=o,a.raw=!0}})})},o=r,g=t,u=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+o()+"</p>"):e.insertContent(o())})},m=function(a){a.on("ResolveName",function(e){"IMG"===e.target.nodeName&&a.dom.hasClass(e.target,g())&&(e.name="pagebreak")})},s=function(e){e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"})};e.add("pagebreak",function(e){u(e),s(e),c(e),m(e)})}();
|
1
public/tinymce/js/tinymce/plugins/paste/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/preview/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),c=function(e){return parseInt(e.getParam("plugin_preview_width","650"),10)},a=function(e){return parseInt(e.getParam("plugin_preview_height","500"),10)},s=function(e){return e.getParam("content_style","")},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){var n="",i=t.dom.encode,e=s(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>"),d.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'">'});var o=t.settings.body_id||"tinymce";-1!==o.indexOf("=")&&(o=(o=t.getParam("body_id","","hash"))[t.id]||o);var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var c=t.settings.directionality?' dir="'+t.settings.directionality+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(o)+'" class="mce-content-body '+i(r)+'"'+i(c)+">"+t.getContent()+'<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);<\/script> </body></html>'},m=function(e,t,n){var i=l(e);if(n)t.src="data:text/html;charset=utf-8,"+encodeURIComponent(i);else{var o=t.contentWindow.document;o.open(),o.write(i),o.close()}},t=function(n){var i=!r.ie,e='<iframe src="" frameborder="0"'+(i?' sandbox="allow-scripts"':"")+"></iframe>",t=c(n),o=a(n);n.windowManager.open({title:"Preview",width:t,height:o,html:e,buttons:{text:"Close",onclick:function(e){e.control.parent().parent().close()}},onPostRender:function(e){var t=e.control.getEl("body").firstChild;m(n,t,i)}})},n=function(e){e.addCommand("mcePreview",function(){t(e)})},i=function(e){e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};e.add("preview",function(e){n(e),i(e)})}();
|
1
public/tinymce/js/tinymce/plugins/print/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){t.addCommand("mcePrint",function(){t.getWin().print()})},i=function(t){t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print"})};t.add("print",function(t){n(t),i(t),t.addShortcut("Meta+P","","mcePrint")})}();
|
1
public/tinymce/js/tinymce/plugins/save/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n){return n.getParam("save_enablewhendirty",!0)},c=function(n){return!!n.getParam("save_onsavecallback")},i=function(n){return!!n.getParam("save_oncancelcallback")},r=function(n,e){n.notificationManager.open({text:n.translate(e),type:"error"})},e=function(n){var e;if(e=t.DOM.getParent(n.id,"form"),!o(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():r(n,"Error: Form submit field collision.")),n.nodeChanged()):r(n,"Error: No form element found.")}},l=function(n){var e=a.trim(n.startContent);i(n)?n.execCallback("save_oncancelcallback",n):(n.setContent(e),n.undoManager.clear(),n.nodeChanged())},d=function(n){n.addCommand("mceSave",function(){e(n)}),n.addCommand("mceCancel",function(){l(n)})},s=function(t){return function(n){var e=n.control;t.on("nodeChange dirty",function(){e.disabled(o(t)&&!t.isDirty())})}},u=function(n){n.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:s(n)}),n.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:s(n)}),n.addShortcut("Meta+S","","mceSave")};n.add("save",function(n){u(n),d(n)})}();
|
1
public/tinymce/js/tinymce/plugins/searchreplace/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&c.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.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&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();
|
1
public/tinymce/js/tinymce/plugins/table/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/template/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/textcolor/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=r||e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();
|
1
public/tinymce/js/tinymce/plugins/textpattern/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{setPatterns:function(t){e.set(t)},getPatterns:function(){return e.get()}}},e=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"***",end:"***",format:["bold","italic"]},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],a=function(t){return t.textpattern_patterns!==undefined?t.textpattern_patterns:e},o=tinymce.util.Tools.resolve("tinymce.util.Delay"),i=tinymce.util.Tools.resolve("tinymce.util.VK"),g=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(t,e){for(var n=0;n<t.length;n++)if(0===e.indexOf(t[n].start)&&(!t[n].end||e.lastIndexOf(t[n].end)===e.length-t[n].end.length))return t[n]},c=function(t,e,n,r){var a,o,i,s,d,f,l=t.sort(function(t,e){return t.start.length>e.start.length?-1:t.start.length<e.start.length?1:0});for(o=0;o<l.length;o++)if((a=l[o]).end!==undefined&&(s=a,d=n,f=r,e.substr(d-s.end.length-f,s.end.length)===s.end)&&0<n-r-(i=a).end.length-i.start.length)return a},s=function(t,e,n){if(!1!==e.collapsed){var r=e.startContainer,a=r.data,o=!0===n?1:0;if(3===r.nodeType){var i=c(t,a,e.startOffset,o);if(i!==undefined){var s=a.lastIndexOf(i.end,e.startOffset-o),d=a.lastIndexOf(i.start,s-i.end.length);if(s=a.indexOf(i.end,d+i.start.length),-1!==d){var f=document.createRange();f.setStart(r,d),f.setEnd(r,s+i.end.length);var l=m(t,f.toString());if(!(i===undefined||l!==i||r.data.length<=i.start.length+i.end.length))return{pattern:i,startOffset:d,endOffset:s}}}}}},d=function(t,e,n){var r=t.selection.getRng(!0),a=s(e,r,n);if(a)return function(a,o,i,t){var s=h.isArray(i.pattern.format)?i.pattern.format:[i.pattern.format];if(0!==h.grep(s,function(t){var e=a.formatter.get(t);return e&&e[0].inline}).length)return a.undoManager.transact(function(){var t,e,n,r;t=o,e=i.pattern,n=i.endOffset,r=i.startOffset,(t=0<r?t.splitText(r):t).splitText(n-r+e.end.length),t.deleteData(0,e.start.length),t.deleteData(t.data.length-e.end.length,e.end.length),o=t,s.forEach(function(t){a.formatter.apply(t,{},o)})}),o}(t,r.startContainer,a)},f=function(t,e){return d(t,e,!0)},l=function(t,e){return d(t,e,!1)},u=function(t,e){var n,r,a,o,i,s,d,f,l,c,u;if(n=t.selection,r=t.dom,n.isCollapsed()&&(d=r.getParent(n.getStart(),"p"))){for(l=new g(d,d);i=l.next();)if(3===i.nodeType){o=i;break}if(o){if(!(f=m(e,o.data)))return;if(a=(c=n.getRng(!0)).startContainer,u=c.startOffset,o===a&&(u=Math.max(0,u-f.start.length)),h.trim(o.data).length===f.start.length)return;f.format&&(s=t.formatter.get(f.format))&&s[0].block&&(o.deleteData(0,f.start.length),t.formatter.apply(f.format,{},o),c.setStart(a,u),c.collapse(!0),n.setRng(c)),f.cmd&&t.undoManager.transact(function(){o.deleteData(0,f.start.length),t.execCommand(f.cmd)})}}},p=function(t,e,n){for(var r=0;r<t.length;r++)if(n(t[r],e))return!0},y={handleEnter:function(t,e){var n,r;(n=l(t,e))&&((r=t.dom.createRng()).setStart(n,n.data.length),r.setEnd(n,n.data.length),t.selection.setRng(r)),u(t,e)},handleInlineKey:function(t,e){var n,r,a,o,i;(n=f(t,e))&&(i=t.dom,r=n.data.slice(-1),/[\u00a0 ]/.test(r)&&(n.deleteData(n.data.length-1,1),a=i.doc.createTextNode(r),i.insertAfter(a,n.parentNode),(o=i.createRng()).setStart(a,1),o.setEnd(a,1),t.selection.setRng(o)))},checkCharCode:function(t,e){return p(t,e,function(t,e){return t.charCodeAt(0)===e.charCode})},checkKeyCode:function(t,e){return p(t,e,function(t,e){return t===e.keyCode&&!1===i.modifierPressed(e)})}},v=function(e,n){var r=[",",".",";",":","!","?"],a=[32];e.on("keydown",function(t){13!==t.keyCode||i.modifierPressed(t)||y.handleEnter(e,n.get())},!0),e.on("keyup",function(t){y.checkKeyCode(a,t)&&y.handleInlineKey(e,n.get())}),e.on("keypress",function(t){y.checkCharCode(r,t)&&o.setEditorTimeout(e,function(){y.handleInlineKey(e,n.get())})})};t.add("textpattern",function(t){var e=r(a(t.settings));return v(t,e),n(e)})}();
|
1
public/tinymce/js/tinymce/plugins/toc/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var e,n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("toc_class","mce-toc")},m=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},c=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},a=(e="mcetoc_",n=0,function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}),v=function(n){var o=l(n),t=m(n),e=function(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")}(c(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:a(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},d=function(t){var e,n,o,r,i,c,l,a="",d=v(t),u=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}(d)-1;if(!d.length)return"";for(a+=(i=m(t),c=f.translate("Table of Contents"),l="</"+i+">","<"+i+' contenteditable="true">'+s.DOM.encode(c)+l),e=0;e<d.length;e++){if((o=d[e]).element.id=o.id,r=d[e+1]&&d[e+1].level,u===o.level)a+="<li>";else for(n=u;n<o.level;n++)a+="<ul><li>";if(a+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)a+="</li></ul><li>";else a+="</li>",r||(a+="</ul>");u=o.level}return a},u=function(t){var e=l(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})},o={hasHeaders:function(t){return 0<v(t).length},insertToc:function(t){var e,n,o,r,i=l(t),c=t.$("."+i);o=t,!(r=c).length||0<o.dom.getParents(r[0],".mce-offscreen-selection").length?t.insertContent((n=d(e=t),'<div class="'+e.dom.encode(l(e))+'" contenteditable="false">'+n+"</div>")):u(t)},updateToc:u},r=function(t){t.addCommand("mceInsertToc",function(){o.insertToc(t)}),t.addCommand("mceUpdateToc",function(){o.updateToc(t)})},h=function(t){var n=t.$,o=l(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))})},g=function(n){return function(t){var e=t.control;n.on("LoadContent SetContent change",function(){e.disabled(n.readonly||!o.hasHeaders(n))})}},T=function(t){var e;t.addButton("toc",{tooltip:"Table of Contents",cmd:"mceInsertToc",icon:"toc",onPostRender:g(t)}),t.addButton("tocupdate",{tooltip:"Update",cmd:"mceUpdateToc",icon:"reload"}),t.addMenuItem("toc",{text:"Table of Contents",context:"insert",cmd:"mceInsertToc",onPostRender:g(t)}),t.addContextToolbar((e=t,function(t){return t&&e.dom.is(t,"."+l(e))&&e.getBody().contains(t)}),"tocupdate")};t.add("toc",function(t){r(t),T(t),h(t)})}();
|
154
public/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css
Executable file
@ -0,0 +1,154 @@
|
||||
.mce-visualblocks p {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h1 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h2 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h3 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h4 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h5 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks h6 {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks div:not([data-mce-bogus]) {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks section {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks article {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks blockquote {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks address {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks pre {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin-left: 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks figure {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks hgroup {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks aside {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks figcaption {
|
||||
border: 1px dashed #BBB;
|
||||
}
|
||||
|
||||
.mce-visualblocks ul {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks ol {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.mce-visualblocks dl {
|
||||
padding-top: 10px;
|
||||
border: 1px dashed #BBB;
|
||||
margin: 0 0 1em 3px;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);
|
||||
background-repeat: no-repeat;
|
||||
}
|
1
public/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(){"use strict";var o=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return o(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.fire("VisualBlocks",{state:t})},s=function(e){return e.getParam("visualblocks_default_state",!1)},c=function(e){return e.settings.visualblocks_content_css},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=l.DOM.uniqueId(),r=function(e,t){var n=u.toArray(e.getElementsByTagName("link"));if(0===u.grep(n,function(e){return e.id===a}).length){var o=l.DOM.create("link",{id:a,rel:"stylesheet",href:t});e.getElementsByTagName("head")[0].appendChild(o)}},m=function(e,t,n){var o=e.dom,s=c(e);r(e.getDoc(),s||t+"/css/visualblocks.css"),o.toggleClass(e.getBody(),"mce-visualblocks"),n.set(!n.get()),i(e,n.get())},f=function(e,t,n){e.addCommand("mceVisualBlocks",function(){m(e,t,n)})},d=function(t,e,n){t.on("PreviewFormats AfterPreviewFormats",function(e){n.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===e.type)}),t.on("init",function(){s(t)&&m(t,e,n)}),t.on("remove",function(){t.dom.removeClass(t.getBody(),"mce-visualblocks")})},n=function(n,o){return function(e){var t=e.control;t.active(o.get()),n.on("VisualBlocks",function(e){t.active(e.state)})}},v=function(e,t){e.addButton("visualblocks",{active:!1,title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n(e,t)}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:n(e,t),selectable:!0,context:"view",prependToContext:!0})};e.add("visualblocks",function(e,t){var n=o(!1);f(e,t,n),v(e,n),d(e,t,n)})}();
|
1
public/tinymce/js/tinymce/plugins/visualchars/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/plugins/wordcount/plugin.min.js
vendored
Executable file
1
public/tinymce/js/tinymce/skins/lightgray/content.inline.min.css
vendored
Executable file
@ -0,0 +1 @@
|
||||
.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,.mce-content-body.mce-content-readonly *[contentEditable=true]:hover{outline:none}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.mce-content-body table{-webkit-nbsp-mode:normal}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2}.mce-content-body{line-height:1.3}
|