first commit
This commit is contained in:
231
public/js/admin/common.js
Executable file
231
public/js/admin/common.js
Executable file
@@ -0,0 +1,231 @@
|
||||
//layer popup
|
||||
function commonLayerOpen(thisId){
|
||||
$('#'+thisId).show();
|
||||
}
|
||||
function commonLayerClose(thisId){
|
||||
$('#'+thisId).hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 날짜포맷
|
||||
Date.prototype.format = function(f) {
|
||||
if (!this.valueOf()) return " ";
|
||||
|
||||
var weekName = ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"];
|
||||
var d = this;
|
||||
|
||||
return f.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi, function($1) {
|
||||
switch ($1) {
|
||||
case "yyyy": return d.getFullYear();
|
||||
case "yy": return (d.getFullYear() % 1000).zf(2);
|
||||
case "MM": return (d.getMonth() + 1).zf(2);
|
||||
case "dd": return d.getDate().zf(2);
|
||||
case "E": return weekName[d.getDay()];
|
||||
case "HH": return d.getHours().zf(2);
|
||||
case "hh": return ((h = d.getHours() % 12) ? h : 12).zf(2);
|
||||
case "mm": return d.getMinutes().zf(2);
|
||||
case "ss": return d.getSeconds().zf(2);
|
||||
case "a/p": return d.getHours() < 12 ? "오전" : "오후";
|
||||
default: return $1;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
String.prototype.string = function(len){var s = '', i = 0; while (i++ < len) { s += this; } return s;};
|
||||
String.prototype.zf = function(len){return "0".string(len - this.length) + this;};
|
||||
Number.prototype.zf = function(len){return this.toString().zf(len);};
|
||||
|
||||
// 주소검색
|
||||
//본 예제에서는 도로명 주소 표기 방식에 대한 법령에 따라, 내려오는 데이터를 조합하여 올바른 주소를 구성하는 방법을 설명합니다.
|
||||
function execDaumPostcode() {
|
||||
new daum.Postcode({
|
||||
oncomplete: function(data) {
|
||||
// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
|
||||
|
||||
// 도로명 주소의 노출 규칙에 따라 주소를 조합한다.
|
||||
// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
|
||||
var fullRoadAddr = data.roadAddress; // 도로명 주소 변수
|
||||
var extraRoadAddr = ''; // 도로명 조합형 주소 변수
|
||||
|
||||
// 법정동명이 있을 경우 추가한다. (법정리는 제외)
|
||||
// 법정동의 경우 마지막 문자가 "동/로/가"로 끝난다.
|
||||
if(data.bname !== '' && /[동|로|가]$/g.test(data.bname)){
|
||||
extraRoadAddr += data.bname;
|
||||
}
|
||||
// 건물명이 있고, 공동주택일 경우 추가한다.
|
||||
if(data.buildingName !== '' && data.apartment === 'Y'){
|
||||
extraRoadAddr += (extraRoadAddr !== '' ? ', ' + data.buildingName : data.buildingName);
|
||||
}
|
||||
// 도로명, 지번 조합형 주소가 있을 경우, 괄호까지 추가한 최종 문자열을 만든다.
|
||||
if(extraRoadAddr !== ''){
|
||||
extraRoadAddr = ' (' + extraRoadAddr + ')';
|
||||
}
|
||||
// 도로명, 지번 주소의 유무에 따라 해당 조합형 주소를 추가한다.
|
||||
if(fullRoadAddr !== ''){
|
||||
fullRoadAddr += extraRoadAddr;
|
||||
}
|
||||
|
||||
// 우편번호와 주소 정보를 해당 필드에 넣는다.
|
||||
$("#postcode").val(data.zonecode); //5자리 새우편번호 사용
|
||||
$("#address").val(fullRoadAddr);
|
||||
//document.getElementById('main_jibunAddress').value = data.jibunAddress;
|
||||
|
||||
window.close();
|
||||
}
|
||||
}).open();
|
||||
}
|
||||
|
||||
// 숫자체크
|
||||
function checkNumber(val){
|
||||
var regexp = /^[0-9]*$/
|
||||
if( !regexp.test(val) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 이메일체크
|
||||
function checkEmail(val){
|
||||
var regexp=/^[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[@]{1}[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[.]{1}[A-Za-z]{1,5}$/;
|
||||
if( !regexp.test(val) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 전화번호체크
|
||||
function checkPhone(val){
|
||||
var regexp= /^\d{2,3}-\d{3,4}-\d{4}$/;
|
||||
if( !regexp.test(val) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function setComma(_no) {
|
||||
return _no.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
|
||||
function sortJSON(data, key, way) {
|
||||
return data.sort(function(a, b) {
|
||||
var x = a[key]; var y = b[key];
|
||||
if (way === '123' ) { return ((x < y) ? -1 : ((x > y) ? 1 : 0)); }
|
||||
if (way === '321') { return ((x > y) ? -1 : ((x < y) ? 1 : 0)); }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".no_ready").click(function(){
|
||||
alert("준비중인 페이지입니다 빠른시일내에 오픈할 예정입니다.");
|
||||
return false;
|
||||
});
|
||||
|
||||
// 그리드용 스크립트
|
||||
$(".grid_children").addClass("moving_all");
|
||||
$("#tablet_gnb ul").addClass("moving_all");
|
||||
$("#container_wrap").addClass("moving_all")
|
||||
$("#tablet_gnb li a").addClass("moving_all2");
|
||||
$(".top_wrap").addClass("moving_all");
|
||||
$(".grid").addClass("clearfix");
|
||||
|
||||
//left menu script
|
||||
$("#tablet_gnb>li").click(function(){
|
||||
if($(this).children("a").hasClass("onar")){
|
||||
$("#tablet_gnb>li>a").removeClass("onar");
|
||||
$("#tablet_gnb>li").find(".depth2").slideUp(100);
|
||||
}else{
|
||||
$("#tablet_gnb>li>a").removeClass("onar");
|
||||
$(this).children("a").addClass("onar");
|
||||
$("#tablet_gnb>li").find(".depth2").slideUp(100);
|
||||
$(this).find(".depth2").slideDown(300);
|
||||
}
|
||||
});
|
||||
|
||||
//left 메뉴 감추기
|
||||
$(".bars .b1").click(function(){
|
||||
$("#tablet_wrap").addClass("notive");
|
||||
$("#container_wrap").addClass("notive");
|
||||
$(this).hide(100);
|
||||
$(this).siblings(".a1").show(100);
|
||||
if($(".bars .a1").hasClass("min")){
|
||||
$("#tablet_wrap").removeClass("mintive");
|
||||
}
|
||||
|
||||
})
|
||||
$(".bars .a1").click(function(){
|
||||
$("#tablet_wrap").removeClass("notive");
|
||||
$("#container_wrap").removeClass("notive");
|
||||
$(this).hide(100);
|
||||
$(this).siblings(".b1").show(100);
|
||||
|
||||
if($(".bars .a1").hasClass("min")){
|
||||
$("#tablet_wrap").addClass("mintive");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//공통 tep
|
||||
$(".depth3_tep li a").click(function(){
|
||||
$(".depth3_tep li a").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
});
|
||||
|
||||
|
||||
//type1
|
||||
$(".common_tep.type01 ul li a").click(function(){
|
||||
$(".common_tep.type01 ul li a").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
})
|
||||
//type2
|
||||
$(".common_tep.type2 ul li a").click(function(){
|
||||
$(".common_tep.type2 ul li a").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
});
|
||||
|
||||
// table 내용보기
|
||||
$(".common_table table td.title").click(function(){
|
||||
if(!$(this).hasClass("on")){
|
||||
$(this).parent("tr").next(".docu").slideDown(300);
|
||||
$(this).addClass("on");
|
||||
}else if($(this).hasClass("on")){
|
||||
$(this).parent("tr").next(".docu").slideUp(100);
|
||||
$(this).removeClass("on");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var triggerBookmark = $('.add_bookmark');
|
||||
triggerBookmark.click(function() {
|
||||
if (window.sidebar && window.sidebar.addPanel) { // Firefox <23
|
||||
window.sidebar.addPanel(document.title,window.location.href,'');
|
||||
} else if(window.external && ('AddFavorite' in window.external)) { // Internet Explorer
|
||||
window.external.AddFavorite(location.href,document.title);
|
||||
} else if(window.opera && window.print || window.sidebar && ! (window.sidebar instanceof Node)) { // Opera <15 and Firefox >23
|
||||
triggerBookmark.attr('rel', 'sidebar').attr('title', document.title);
|
||||
return true;
|
||||
} else { // other browsers (WebKit)
|
||||
alert((navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'Ctrl') + '+D 키를 누르시면 즐겨찾기에 추가하실 수 있습니다.');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
if ($('#iquersier').is(':hidden')){
|
||||
$(".bars .a1").show(100);
|
||||
$(".bars .a1").addClass("min");
|
||||
}
|
||||
|
||||
var wh=$(this).height();
|
||||
var th=$("#tablet_gnb").height();
|
||||
|
||||
$("#tablet_gnb").height(wh-80);
|
||||
})
|
||||
|
||||
|
||||
14
public/js/admin/ie8-body.js
Executable file
14
public/js/admin/ie8-body.js
Executable file
@@ -0,0 +1,14 @@
|
||||
$(document).ready(function(){
|
||||
$('*').each(function(){
|
||||
var font_weight = $(this).css('font-weight');
|
||||
if (font_weight == '100') {
|
||||
$(this).addClass('fw100');
|
||||
} else if(font_weight == '300') {
|
||||
$(this).addClass('fw300');
|
||||
} else if(font_weight == '500') {
|
||||
$(this).addClass('fw500');
|
||||
} else if(font_weight == '700' || font_weight == 'bold') {
|
||||
$(this).addClass('fw700');
|
||||
}
|
||||
});
|
||||
});
|
||||
278
public/js/admin/jquery.easy_slides.js
Executable file
278
public/js/admin/jquery.easy_slides.js
Executable file
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
EasySlides - слидер
|
||||
Autor 2017 Shabanov Ivan (Шабанов Иван)
|
||||
Usage:
|
||||
|
||||
|
||||
$('.slider').EasySlides({
|
||||
'autoplay': true,
|
||||
'timeout': 3000,
|
||||
'show': 5, //Сколь-ко позывать слайдов (по умолчанию 5: 1-активный, 2-предыдущих и 2-следующих)
|
||||
'vertical': false, //Если True то слайдер вертикальный, слайды листаются движением вверх/вниз
|
||||
'reverse': false, //Перевернутый слайдер
|
||||
'touchevents': true, //Вкючено ли события на прикосновения к сладеру (листания и т.п)
|
||||
'delayaftershow': 300, //Задержка после смены слайдера, в это время слайдер нельзя листать
|
||||
'stepbystep': true, //При клике на далекий слайд перейти к нему последовательно, а не сразу
|
||||
'startslide': 0, //Стартовый слайд
|
||||
'beforeshow': function () {},
|
||||
'aftershow': function () {},
|
||||
});
|
||||
|
||||
*/
|
||||
(function( $ ){
|
||||
|
||||
$.fn.EasySlides = function( options ) {
|
||||
var settings = $.extend( {
|
||||
'autoplay': false,
|
||||
'timeout': 3000,
|
||||
'show': 5,
|
||||
'vertical': false,
|
||||
'reverse': false,
|
||||
'touchevents': true,
|
||||
'delayaftershow': 300,
|
||||
'stepbystep': true,
|
||||
'startslide': 0,
|
||||
'distancetochange': 10,
|
||||
'beforeshow': function () {},
|
||||
'aftershow': function () {},
|
||||
|
||||
}, options);
|
||||
return this.each(function() {
|
||||
var this_slider = this;
|
||||
var EasySlidesTimer;
|
||||
var EasySlidesCanChange = true;
|
||||
|
||||
var count = $(this_slider).children('*:not(.next_button, .prev_button, .nav_indicators)').length;
|
||||
var cur_slide = 0;
|
||||
var mousedowned = false;
|
||||
var need_slide = 0;
|
||||
var slides;
|
||||
if (count > 0) {
|
||||
|
||||
while (count < settings['show']) {
|
||||
var html = $(this_slider).html();
|
||||
$(html).appendTo(this_slider);
|
||||
$(this_slider).children('.next_button:eq(0), .prev_button:eq(0), .nav_indicators:eq(0)').remove();
|
||||
slides = $(this_slider).children('*:not(.next_button, .prev_button, .nav_indicators)');
|
||||
|
||||
count = $(slides).length;
|
||||
}
|
||||
slides = $(this_slider).children('*:not(.next_button, .prev_button, .nav_indicators)');
|
||||
|
||||
if ($(this_slider).children('.nav_indicators').length > 0) {
|
||||
var nav_indicators = '<ul>';
|
||||
while (need_slide < count) {
|
||||
need_slide ++;
|
||||
nav_indicators = nav_indicators + '<li>' + need_slide + '</li>';
|
||||
}
|
||||
nav_indicators = nav_indicators + '</ul>';
|
||||
$(this_slider).children('.nav_indicators').html(nav_indicators);
|
||||
need_slide = 0
|
||||
}
|
||||
var EasySlidesLoopToNeeded = function() {
|
||||
var next;
|
||||
var left = need_slide - cur_slide;
|
||||
var right = cur_slide - need_slide
|
||||
if (left < 0) {left = left + count;}
|
||||
if (right < 0) {right = right + count;}
|
||||
if (cur_slide != need_slide) {
|
||||
if ((left) < (right)) {
|
||||
console.log('+');
|
||||
next = cur_slide + 1;
|
||||
} else {
|
||||
console.log('-');
|
||||
next = cur_slide - 1;
|
||||
}
|
||||
EasySlidesNext(next);
|
||||
setTimeout(EasySlidesLoopToNeeded, settings['delayaftershow']);
|
||||
};
|
||||
}
|
||||
var EasySlidesNext = function (nextslide) {
|
||||
if (EasySlidesCanChange) {
|
||||
EasySlidesCanChange = false;
|
||||
setTimeout(function() {EasySlidesCanChange = true;}, settings['delayaftershow']);
|
||||
clearTimeout(EasySlidesTimer);
|
||||
if (typeof settings['beforeshow'] == 'function') {
|
||||
settings['beforeshow'];
|
||||
};
|
||||
var i = 0;
|
||||
if (count > 0) {
|
||||
if (typeof nextslide == 'number') {
|
||||
cur_slide = nextslide;
|
||||
} else {
|
||||
cur_slide ++;
|
||||
nextslide = cur_slide;
|
||||
}
|
||||
while (cur_slide < 0) {cur_slide = cur_slide + count;}
|
||||
while (cur_slide >= count) {cur_slide = cur_slide - count;}
|
||||
while (nextslide < 0) {nextslide = nextslide + count;}
|
||||
while (nextslide >= count) {nextslide = nextslide - count;}
|
||||
$(this_slider).children('.nav_indicators').find('ul').find('li').removeClass('active');
|
||||
|
||||
$(this_slider).find('.nav_indicators ul li:nth-child(' + (nextslide + 1) + ')').addClass('active');
|
||||
i = 0;
|
||||
/*
|
||||
$(this_slider).children('*:not(.next_button, .prev_button, .nav_indicators)').each(function() {
|
||||
*/
|
||||
$(slides).each(function() {
|
||||
|
||||
|
||||
var cssclass = '';
|
||||
var icount = 0;
|
||||
icount = i - nextslide ;
|
||||
while (icount < 0) {
|
||||
icount = icount + count;
|
||||
};
|
||||
|
||||
while (icount > count) {
|
||||
icount = icount - count;
|
||||
};
|
||||
|
||||
if (icount == 0) {
|
||||
cssclass = 'active';
|
||||
$(this_slider).find('.' + cssclass+ ':not(.nav_indicators ul li)').removeClass(cssclass);
|
||||
$(this).removeClass('hidden');
|
||||
$(this).addClass(cssclass);
|
||||
} else if (icount < settings['show'] / 2) {
|
||||
cssclass = 'next' + icount;
|
||||
$(this_slider).find('.' + cssclass).removeClass(cssclass);
|
||||
$(this).removeClass('hidden');
|
||||
$(this).addClass(cssclass);
|
||||
} else if (icount > count - (settings['show'] / 2)) {
|
||||
cssclass = 'prev' + (count - icount);
|
||||
$(this_slider).find('.' + cssclass).removeClass(cssclass);
|
||||
$(this).removeClass('hidden');
|
||||
$(this).addClass(cssclass);
|
||||
} else {
|
||||
$(this).addClass('hidden');
|
||||
}
|
||||
i++;
|
||||
});
|
||||
if (settings['autoplay']) {
|
||||
clearTimeout(EasySlidesTimer);
|
||||
EasySlidesTimer = setTimeout(function() {
|
||||
EasySlidesNext();
|
||||
}, settings['timeout']);
|
||||
}
|
||||
}
|
||||
if (typeof settings['aftershow'] == 'function') {
|
||||
settings['aftershow'];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
EasySlidesNext(settings['startslide']);
|
||||
/*
|
||||
$(this_slider).children(':not(.next_button, .prev_button, .nav_indicators)').click(function () {
|
||||
*/
|
||||
$(slides).click(function () {
|
||||
need_slide = $(this_slider).children().index(this);
|
||||
if (settings['stepbystep']) {
|
||||
EasySlidesLoopToNeeded()
|
||||
} else {
|
||||
EasySlidesNext( need_slide );
|
||||
}
|
||||
});
|
||||
$(this_slider).children('.nav_indicators').find('ul').find('li').click(function () {
|
||||
need_slide = $(this_slider).find('.nav_indicators ul li').index(this);
|
||||
if (settings['stepbystep']) {
|
||||
EasySlidesLoopToNeeded()
|
||||
} else {
|
||||
EasySlidesNext( need_slide );
|
||||
}
|
||||
});
|
||||
|
||||
$(this_slider).find('.next_button').click(function() {
|
||||
EasySlidesCanChange = true;
|
||||
EasySlidesNext();
|
||||
});
|
||||
$(this_slider).find('.prev_button').click(function() {
|
||||
EasySlidesCanChange = true;
|
||||
cur_slide --;
|
||||
EasySlidesNext(cur_slide);
|
||||
});
|
||||
if (settings['touchevents']) {
|
||||
var EasySliderMoved = function (xcur, ycur) {
|
||||
var offset = $(slides).find('.active').offset();
|
||||
var left = 0;
|
||||
var top = 0;
|
||||
if (typeof offset !== 'undefined') {
|
||||
left = offset.left;
|
||||
top = offset.top;
|
||||
}
|
||||
|
||||
var p0 = $(this_slider).data('posstart'),
|
||||
p1 = { x: xcur,
|
||||
y: ycur,
|
||||
l: left,
|
||||
t: top,
|
||||
},
|
||||
d = 0;
|
||||
if (typeof p0 === 'undefined') {
|
||||
p0 = p1;
|
||||
$(this_slider).data('posstart', p1);
|
||||
}
|
||||
|
||||
if (settings['vertical']) {
|
||||
d = p1.y - p0.y;
|
||||
top = p0.t + d;
|
||||
//$(this_slider).find('.active:not(.nav_indicators ul li)').offset({'top': top});
|
||||
} else {
|
||||
d = p1.x - p0.x;
|
||||
left = p0.l + d;
|
||||
//$(this_slider).find('.active:not(.nav_indicators ul li)').offset({'left': left});
|
||||
}
|
||||
if (settings['reverse']) {
|
||||
d = -d;
|
||||
}
|
||||
if ((Math.abs(d) > settings['distancetochange']) && (EasySlidesCanChange)) {
|
||||
$(this_slider).data('posstart' , p1);
|
||||
|
||||
if (d > 0) {
|
||||
cur_slide --;
|
||||
} else {
|
||||
cur_slide ++;
|
||||
}
|
||||
EasySlidesNext(cur_slide);
|
||||
}
|
||||
}
|
||||
/*События*/
|
||||
$(this_slider).bind('mousemove', function(e) {
|
||||
e.preventDefault();
|
||||
if (e.buttons > 0) {
|
||||
EasySliderMoved(e.pageX , e.pageY);
|
||||
mousedowned = true;
|
||||
} else {
|
||||
if (mousedowned) {
|
||||
EasySliderMoved(e.pageX , e.pageY);
|
||||
$(this_slider).removeData('posstart');
|
||||
mousedowned = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this_slider).bind('mouseup', function(e) {
|
||||
e.preventDefault();
|
||||
if (mousedowned) {
|
||||
EasySliderMoved(e.pageX , e.pageY);
|
||||
$(this_slider).removeData('posstart');
|
||||
mousedowned = false;
|
||||
}
|
||||
})
|
||||
|
||||
$(this_slider).bind('touchmove', function(e) {
|
||||
e.preventDefault();
|
||||
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
||||
EasySliderMoved(touch.pageX , touch.pageY);
|
||||
});
|
||||
$(this_slider).bind('touchend', function(e) {
|
||||
e.preventDefault();
|
||||
$(this_slider).removeData('posstart');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})( jQuery );
|
||||
|
||||
|
||||
544
public/js/admin/jquery.multi-select.js
Executable file
544
public/js/admin/jquery.multi-select.js
Executable file
@@ -0,0 +1,544 @@
|
||||
/*
|
||||
* MultiSelect v0.9.12
|
||||
* Copyright (c) 2012 Louis Cuny
|
||||
*
|
||||
* This program is free software. It comes without any warranty, to
|
||||
* the extent permitted by applicable law. You can redistribute it
|
||||
* and/or modify it under the terms of the Do What The Fuck You Want
|
||||
* To Public License, Version 2, as published by Sam Hocevar. See
|
||||
* http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/* MULTISELECT CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var MultiSelect = function (element, options) {
|
||||
this.options = options;
|
||||
this.$element = $(element);
|
||||
this.$container = $('<div/>', { 'class': "ms-container" });
|
||||
this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
|
||||
this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });
|
||||
this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.$selectionUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
|
||||
this.scrollTo = 0;
|
||||
this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';
|
||||
};
|
||||
|
||||
MultiSelect.prototype = {
|
||||
constructor: MultiSelect,
|
||||
|
||||
init: function(){
|
||||
var that = this,
|
||||
ms = this.$element;
|
||||
|
||||
if (ms.next('.ms-container').length === 0){
|
||||
ms.css({ position: 'absolute', left: '-9999px' });
|
||||
ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');
|
||||
this.$container.attr('id', 'ms-'+ms.attr('id'));
|
||||
this.$container.addClass(that.options.cssClass);
|
||||
ms.find('option').each(function(){
|
||||
that.generateLisFromOption(this);
|
||||
});
|
||||
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
|
||||
if (that.options.selectableHeader){
|
||||
that.$selectableContainer.append(that.options.selectableHeader);
|
||||
}
|
||||
that.$selectableContainer.append(that.$selectableUl);
|
||||
if (that.options.selectableFooter){
|
||||
that.$selectableContainer.append(that.options.selectableFooter);
|
||||
}
|
||||
|
||||
if (that.options.selectionHeader){
|
||||
that.$selectionContainer.append(that.options.selectionHeader);
|
||||
}
|
||||
that.$selectionContainer.append(that.$selectionUl);
|
||||
if (that.options.selectionFooter){
|
||||
that.$selectionContainer.append(that.options.selectionFooter);
|
||||
}
|
||||
|
||||
that.$container.append(that.$selectableContainer);
|
||||
that.$container.append(that.$selectionContainer);
|
||||
ms.after(that.$container);
|
||||
|
||||
that.activeMouse(that.$selectableUl);
|
||||
that.activeKeyboard(that.$selectableUl);
|
||||
|
||||
var action = that.options.dblClick ? 'dblclick' : 'click';
|
||||
|
||||
that.$selectableUl.on(action, '.ms-elem-selectable', function(){
|
||||
that.select($(this).data('ms-value'));
|
||||
});
|
||||
that.$selectionUl.on(action, '.ms-elem-selection', function(){
|
||||
that.deselect($(this).data('ms-value'));
|
||||
});
|
||||
|
||||
that.activeMouse(that.$selectionUl);
|
||||
that.activeKeyboard(that.$selectionUl);
|
||||
|
||||
ms.on('focus', function(){
|
||||
that.$selectableUl.focus();
|
||||
});
|
||||
}
|
||||
|
||||
var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
|
||||
that.select(selectedValues, 'init');
|
||||
|
||||
if (typeof that.options.afterInit === 'function') {
|
||||
that.options.afterInit.call(this, this.$container);
|
||||
}
|
||||
},
|
||||
|
||||
'generateLisFromOption' : function(option, index, $container){
|
||||
var that = this,
|
||||
ms = that.$element,
|
||||
attributes = "",
|
||||
$option = $(option);
|
||||
|
||||
for (var cpt = 0; cpt < option.attributes.length; cpt++){
|
||||
var attr = option.attributes[cpt];
|
||||
|
||||
if(attr.name !== 'value' && attr.name !== 'disabled'){
|
||||
attributes += attr.name+'="'+attr.value+'" ';
|
||||
}
|
||||
}
|
||||
var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),
|
||||
selectedLi = selectableLi.clone(),
|
||||
value = $option.val(),
|
||||
elementId = that.sanitize(value);
|
||||
|
||||
selectableLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selectable')
|
||||
.attr('id', elementId+'-selectable');
|
||||
|
||||
selectedLi
|
||||
.data('ms-value', value)
|
||||
.addClass('ms-elem-selection')
|
||||
.attr('id', elementId+'-selection')
|
||||
.hide();
|
||||
|
||||
if ($option.prop('disabled') || ms.prop('disabled')){
|
||||
selectedLi.addClass(that.options.disabledClass);
|
||||
selectableLi.addClass(that.options.disabledClass);
|
||||
}
|
||||
|
||||
var $optgroup = $option.parent('optgroup');
|
||||
|
||||
if ($optgroup.length > 0){
|
||||
var optgroupLabel = $optgroup.attr('label'),
|
||||
optgroupId = that.sanitize(optgroupLabel),
|
||||
$selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),
|
||||
$selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);
|
||||
|
||||
if ($selectableOptgroup.length === 0){
|
||||
var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
|
||||
optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
|
||||
|
||||
$selectableOptgroup = $(optgroupContainerTpl);
|
||||
$selectionOptgroup = $(optgroupContainerTpl);
|
||||
$selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
|
||||
$selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);
|
||||
$selectableOptgroup.append($(optgroupTpl));
|
||||
$selectionOptgroup.append($(optgroupTpl));
|
||||
if (that.options.selectableOptgroup){
|
||||
$selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val();}).get();
|
||||
that.select(values);
|
||||
});
|
||||
$selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
|
||||
var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val();}).get();
|
||||
that.deselect(values);
|
||||
});
|
||||
}
|
||||
that.$selectableUl.append($selectableOptgroup);
|
||||
that.$selectionUl.append($selectionOptgroup);
|
||||
}
|
||||
index = index === undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
|
||||
selectableLi.insertAt(index, $selectableOptgroup.children());
|
||||
selectedLi.insertAt(index, $selectionOptgroup.children());
|
||||
} else {
|
||||
index = index === undefined ? that.$selectableUl.children().length : index;
|
||||
|
||||
selectableLi.insertAt(index, that.$selectableUl);
|
||||
selectedLi.insertAt(index, that.$selectionUl);
|
||||
}
|
||||
},
|
||||
|
||||
'addOption' : function(options){
|
||||
var that = this;
|
||||
|
||||
if (options.value !== undefined && options.value !== null){
|
||||
options = [options];
|
||||
}
|
||||
$.each(options, function(index, option){
|
||||
if (option.value !== undefined && option.value !== null &&
|
||||
that.$element.find("option[value='"+option.value+"']").length === 0){
|
||||
var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
|
||||
$container = option.nested === undefined ? that.$element : $("optgroup[label='"+option.nested+"']"),
|
||||
index = parseInt((typeof option.index === 'undefined' ? $container.children().length : option.index));
|
||||
|
||||
if (option.optionClass) {
|
||||
$option.addClass(option.optionClass);
|
||||
}
|
||||
|
||||
if (option.disabled) {
|
||||
$option.prop('disabled', true);
|
||||
}
|
||||
|
||||
$option.insertAt(index, $container);
|
||||
that.generateLisFromOption($option.get(0), index, option.nested);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'escapeHTML' : function(text){
|
||||
return $("<div>").text(text).html();
|
||||
},
|
||||
|
||||
'activeKeyboard' : function($list){
|
||||
var that = this;
|
||||
|
||||
$list.on('focus', function(){
|
||||
$(this).addClass('ms-focus');
|
||||
})
|
||||
.on('blur', function(){
|
||||
$(this).removeClass('ms-focus');
|
||||
})
|
||||
.on('keydown', function(e){
|
||||
switch (e.which) {
|
||||
case 40:
|
||||
case 38:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
|
||||
return;
|
||||
case 37:
|
||||
case 39:
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.switchList($list);
|
||||
return;
|
||||
case 9:
|
||||
if(that.$element.is('[tabindex]')){
|
||||
e.preventDefault();
|
||||
var tabindex = parseInt(that.$element.attr('tabindex'), 10);
|
||||
tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
|
||||
$('[tabindex="'+(tabindex)+'"]').focus();
|
||||
return;
|
||||
}else{
|
||||
if(e.shiftKey){
|
||||
that.$element.trigger('focus');
|
||||
}
|
||||
}
|
||||
}
|
||||
if($.inArray(e.which, that.options.keySelect) > -1){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.selectHighlighted($list);
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'moveHighlight': function($list, direction){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$currElem = $elems.filter('.ms-hover'),
|
||||
$nextElem = null,
|
||||
elemHeight = $elems.first().outerHeight(),
|
||||
containerHeight = $list.height(),
|
||||
containerSelector = '#'+this.$container.prop('id');
|
||||
|
||||
$elems.removeClass('ms-hover');
|
||||
if (direction === 1){ // DOWN
|
||||
|
||||
$nextElem = $currElem.nextAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$nextOptgroupLi = $optgroupLi.next(':visible');
|
||||
|
||||
if ($nextOptgroupLi.length > 0){
|
||||
$nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.first();
|
||||
}
|
||||
}
|
||||
} else if (direction === -1){ // UP
|
||||
|
||||
$nextElem = $currElem.prevAll(this.elemsSelector).first();
|
||||
if ($nextElem.length === 0){
|
||||
var $optgroupUl = $currElem.parent();
|
||||
|
||||
if ($optgroupUl.hasClass('ms-optgroup')){
|
||||
var $optgroupLi = $optgroupUl.parent(),
|
||||
$prevOptgroupLi = $optgroupLi.prev(':visible');
|
||||
|
||||
if ($prevOptgroupLi.length > 0){
|
||||
$nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
} else {
|
||||
$nextElem = $elems.last();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nextElem.length > 0){
|
||||
$nextElem.addClass('ms-hover');
|
||||
var scrollTo = $list.scrollTop() + $nextElem.position().top -
|
||||
containerHeight / 2 + elemHeight / 2;
|
||||
|
||||
$list.scrollTop(scrollTo);
|
||||
}
|
||||
},
|
||||
|
||||
'selectHighlighted' : function($list){
|
||||
var $elems = $list.find(this.elemsSelector),
|
||||
$highlightedElem = $elems.filter('.ms-hover').first();
|
||||
|
||||
if ($highlightedElem.length > 0){
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.select($highlightedElem.data('ms-value'));
|
||||
} else {
|
||||
this.deselect($highlightedElem.data('ms-value'));
|
||||
}
|
||||
$elems.removeClass('ms-hover');
|
||||
}
|
||||
},
|
||||
|
||||
'switchList' : function($list){
|
||||
$list.blur();
|
||||
this.$container.find(this.elemsSelector).removeClass('ms-hover');
|
||||
if ($list.parent().hasClass('ms-selectable')){
|
||||
this.$selectionUl.focus();
|
||||
} else {
|
||||
this.$selectableUl.focus();
|
||||
}
|
||||
},
|
||||
|
||||
'activeMouse' : function($list){
|
||||
var that = this;
|
||||
|
||||
this.$container.on('mouseenter', that.elemsSelector, function(){
|
||||
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
|
||||
$(this).addClass('ms-hover');
|
||||
});
|
||||
|
||||
this.$container.on('mouseleave', that.elemsSelector, function () {
|
||||
$(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
|
||||
});
|
||||
},
|
||||
|
||||
'refresh' : function() {
|
||||
this.destroy();
|
||||
this.$element.multiSelect(this.options);
|
||||
},
|
||||
|
||||
'destroy' : function(){
|
||||
$("#ms-"+this.$element.attr("id")).remove();
|
||||
this.$element.off('focus');
|
||||
this.$element.css('position', '').css('left', '');
|
||||
this.$element.removeData('multiselect');
|
||||
},
|
||||
|
||||
'select' : function(value, method){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (method === 'init'){
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
|
||||
}
|
||||
|
||||
if (selectables.length > 0){
|
||||
selectables.addClass('ms-selected').hide();
|
||||
selections.addClass('ms-selected').show();
|
||||
|
||||
options.prop('selected', true);
|
||||
|
||||
that.$container.find(that.elemsSelector).removeClass('ms-hover');
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (that.options.keepOrder && method !== 'init'){
|
||||
var selectionLiLast = that.$selectionUl.find('.ms-selected');
|
||||
if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
|
||||
selections.insertAfter(selectionLiLast.last());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method !== 'init'){
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterSelect === 'function') {
|
||||
that.options.afterSelect.call(this, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'deselect' : function(value){
|
||||
if (typeof value === 'string'){ value = [value]; }
|
||||
|
||||
var that = this,
|
||||
ms = this.$element,
|
||||
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
|
||||
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
|
||||
selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
|
||||
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
|
||||
|
||||
if (selections.length > 0){
|
||||
selectables.removeClass('ms-selected').show();
|
||||
selections.removeClass('ms-selected').hide();
|
||||
options.prop('selected', false);
|
||||
|
||||
that.$container.find(that.elemsSelector).removeClass('ms-hover');
|
||||
|
||||
var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
|
||||
if (selectableOptgroups.length > 0){
|
||||
selectableOptgroups.each(function(){
|
||||
var selectablesLi = $(this).find('.ms-elem-selectable');
|
||||
if (selectablesLi.filter(':not(.ms-selected)').length > 0){
|
||||
$(this).find('.ms-optgroup-label').show();
|
||||
}
|
||||
});
|
||||
|
||||
var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
|
||||
selectionOptgroups.each(function(){
|
||||
var selectionsLi = $(this).find('.ms-elem-selection');
|
||||
if (selectionsLi.filter('.ms-selected').length === 0){
|
||||
$(this).find('.ms-optgroup-label').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
ms.trigger('change');
|
||||
if (typeof that.options.afterDeselect === 'function') {
|
||||
that.options.afterDeselect.call(this, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'select_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option:not(":disabled")').prop('selected', true);
|
||||
this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
|
||||
this.$selectionUl.find('.ms-optgroup-label').show();
|
||||
this.$selectableUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
|
||||
this.$selectionUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterSelect === 'function') {
|
||||
var selectedValues = $.grep(ms.val(), function(item){
|
||||
return $.inArray(item, values) < 0;
|
||||
});
|
||||
this.options.afterSelect.call(this, selectedValues);
|
||||
}
|
||||
},
|
||||
|
||||
'deselect_all' : function(){
|
||||
var ms = this.$element,
|
||||
values = ms.val();
|
||||
|
||||
ms.find('option').prop('selected', false);
|
||||
this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
|
||||
this.$selectionUl.find('.ms-optgroup-label').hide();
|
||||
this.$selectableUl.find('.ms-optgroup-label').show();
|
||||
this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
|
||||
this.$selectableUl.focus();
|
||||
ms.trigger('change');
|
||||
if (typeof this.options.afterDeselect === 'function') {
|
||||
this.options.afterDeselect.call(this, values);
|
||||
}
|
||||
},
|
||||
|
||||
sanitize: function(value){
|
||||
var hash = 0, i, character;
|
||||
if (value.length == 0) return hash;
|
||||
var ls = 0;
|
||||
for (i = 0, ls = value.length; i < ls; i++) {
|
||||
character = value.charCodeAt(i);
|
||||
hash = ((hash<<5)-hash)+character;
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
||||
/* MULTISELECT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.multiSelect = function () {
|
||||
var option = arguments[0],
|
||||
args = arguments;
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('multiselect'),
|
||||
options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
|
||||
|
||||
if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
|
||||
|
||||
if (typeof option === 'string'){
|
||||
data[option](args[1]);
|
||||
} else {
|
||||
data.init();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.multiSelect.defaults = {
|
||||
keySelect: [32],
|
||||
selectableOptgroup: false,
|
||||
disabledClass : 'disabled',
|
||||
dblClick : false,
|
||||
keepOrder: false,
|
||||
cssClass: ''
|
||||
};
|
||||
|
||||
$.fn.multiSelect.Constructor = MultiSelect;
|
||||
|
||||
$.fn.insertAt = function(index, $parent) {
|
||||
return this.each(function() {
|
||||
if (index === 0) {
|
||||
$parent.prepend(this);
|
||||
} else {
|
||||
$parent.children().eq(index - 1).after(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
}(window.jQuery);
|
||||
143
public/js/admin/jquery.multiselect.js
Executable file
143
public/js/admin/jquery.multiselect.js
Executable file
@@ -0,0 +1,143 @@
|
||||
(function($) {
|
||||
|
||||
var options = {};
|
||||
|
||||
$.fn.gs_multiselect = function(params) {
|
||||
options = $.extend({}, $.fn.gs_multiselect.defaults, params);
|
||||
|
||||
return this.each(function() {
|
||||
var list_options={};
|
||||
var list_names={};
|
||||
var idx={};
|
||||
var rw=Math.min(400,this.offsetWidth);
|
||||
var rh=this.offsetHeight;
|
||||
var t=document.createElement('table');
|
||||
var to_sel=this.parentNode.replaceChild(t,this);
|
||||
var from_sel=$('<select multiple="multiple"></select>').get(0);
|
||||
var r=t.insertRow(0);
|
||||
if (options.buttons) {
|
||||
var c1=r.insertCell(0);
|
||||
var c2=r.insertCell(1);
|
||||
var c3=r.insertCell(2);
|
||||
var btl_all=$('<input type="button" value="+">').get(0);
|
||||
//var tl_filter=$('<input type="text">').get(0);
|
||||
//c1.appendChild(tl_filter);
|
||||
c1.appendChild(btl_all);
|
||||
var btr_all=btl_all.cloneNode(true);
|
||||
c3.appendChild(btr_all);
|
||||
btl_all.onclick=function () {
|
||||
$('option',from_sel).each(function() {this.selected=!this.selected;});
|
||||
$('option',to_sel).attr('selected',false);
|
||||
}
|
||||
btr_all.onclick=function () {
|
||||
$('option',from_sel).attr('selected',false);
|
||||
$('option',to_sel).each(function() {this.selected=!this.selected;});
|
||||
}
|
||||
r=t.insertRow(1);
|
||||
}
|
||||
var fc=r.insertCell(0);
|
||||
var mc=r.insertCell(1);
|
||||
var lc=r.insertCell(2);
|
||||
var o_lc=lc;
|
||||
|
||||
lc.appendChild(to_sel);
|
||||
$(fc).append($(from_sel));
|
||||
//var from_sel=fc.firstChild;
|
||||
var sel_name=to_sel.getAttribute('name');
|
||||
to_sel.setAttribute('name','');
|
||||
$(from_sel).html($(to_sel).html());
|
||||
$(this).html('');
|
||||
from_sel.style.height=to_sel.style.height=rh+'px';
|
||||
from_sel.style.width=to_sel.style.width=rw+'px';
|
||||
var fb=$('<input type="button" value="»">');
|
||||
var bb=$('<input type="button" value="«">');
|
||||
mc.appendChild(fb.get(0));
|
||||
mc.appendChild(document.createElement('br'));
|
||||
mc.appendChild(bb.get(0));
|
||||
var list=from_sel.cloneNode(true);
|
||||
//if (list.innerHTML!='') $(list).filter('option').each(function (i) {
|
||||
if (list.innerHTML!='') $('option',list).each(function (i) {
|
||||
list_options[this.value]=i;
|
||||
list_names[i]=this.innerHTML;
|
||||
})
|
||||
// start of functions
|
||||
fbutton=function (){
|
||||
var ol=[];
|
||||
var os=from_sel.getElementsByTagName('option');
|
||||
for (var key=0;key<os.length;key++) {
|
||||
if (os[key].selected) {
|
||||
ol.push(os[key]);
|
||||
idx[os[key].value]=list_options[os[key].value];
|
||||
}
|
||||
}
|
||||
for (var key=0;key<ol.length;key++) {
|
||||
var n=from_sel.removeChild(ol[key]);
|
||||
}
|
||||
|
||||
to_sel.innerHTML='';
|
||||
$('input',o_lc).remove();
|
||||
for (key in list_options) {
|
||||
var add=false;
|
||||
for (i in idx) {
|
||||
if (list_options[key]==idx[i]) {
|
||||
add=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (add) {
|
||||
to_sel.appendChild($('<option value="'+key+'">'+list_names[list_options[key]]+'</option>').get(0));
|
||||
o_lc.appendChild($('<input type="hidden" name="'+sel_name+'" value="'+key+'">').get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bbutton=function (){
|
||||
var ol=[];
|
||||
var os=to_sel.getElementsByTagName('option');
|
||||
for (var key=os.length-1;key>=0;key--) {
|
||||
if (os[key].selected) {
|
||||
ol.push(os[key]);
|
||||
to_sel.removeChild(os[key]);
|
||||
}
|
||||
}
|
||||
idx={};
|
||||
var os=to_sel.getElementsByTagName('option');
|
||||
for (var key=0;key<os.length;key++) {
|
||||
idx[os[key].value]=list_options[os[key].value];
|
||||
}
|
||||
|
||||
from_sel.innerHTML='';
|
||||
$('input',o_lc).remove();
|
||||
for (key in list_options) {
|
||||
var add=true;
|
||||
for (i in idx) {
|
||||
if (list_options[key]==idx[i]) {
|
||||
add=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (add) {
|
||||
from_sel.appendChild($('<option value="'+key+'">'+list_names[list_options[key]]+'</option>').get(0));
|
||||
} else {
|
||||
o_lc.appendChild($('<input type="hidden" name="'+sel_name+'" value="'+key+'">').get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
// end of functions
|
||||
fb.click(fbutton);
|
||||
bb.click(bbutton);
|
||||
$(from_sel).dblclick(fbutton);
|
||||
$(to_sel).dblclick(bbutton);
|
||||
fbutton();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
$.fn.gs_multiselect.defaults = {
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
181
public/js/admin/jquery.quicksearch.js
Executable file
181
public/js/admin/jquery.quicksearch.js
Executable file
@@ -0,0 +1,181 @@
|
||||
(function($, window, document, undefined) {
|
||||
$.fn.quicksearch = function (target, opt) {
|
||||
|
||||
var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({
|
||||
delay: 100,
|
||||
selector: null,
|
||||
stripeRows: null,
|
||||
loader: null,
|
||||
noResults: '',
|
||||
matchedResultsCount: 0,
|
||||
bind: 'keyup',
|
||||
onBefore: function () {
|
||||
return;
|
||||
},
|
||||
onAfter: function () {
|
||||
return;
|
||||
},
|
||||
show: function () {
|
||||
this.style.display = "";
|
||||
},
|
||||
hide: function () {
|
||||
this.style.display = "none";
|
||||
},
|
||||
prepareQuery: function (val) {
|
||||
return val.toLowerCase().split(' ');
|
||||
},
|
||||
testQuery: function (query, txt, _row) {
|
||||
for (var i = 0; i < query.length; i += 1) {
|
||||
if (txt.indexOf(query[i]) === -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}, opt);
|
||||
|
||||
this.go = function () {
|
||||
|
||||
var i = 0,
|
||||
numMatchedRows = 0,
|
||||
noresults = true,
|
||||
query = options.prepareQuery(val),
|
||||
val_empty = (val.replace(' ', '').length === 0);
|
||||
|
||||
for (var i = 0, len = rowcache.length; i < len; i++) {
|
||||
if (val_empty || options.testQuery(query, cache[i], rowcache[i])) {
|
||||
options.show.apply(rowcache[i]);
|
||||
noresults = false;
|
||||
numMatchedRows++;
|
||||
} else {
|
||||
options.hide.apply(rowcache[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (noresults) {
|
||||
this.results(false);
|
||||
} else {
|
||||
this.results(true);
|
||||
this.stripe();
|
||||
}
|
||||
|
||||
this.matchedResultsCount = numMatchedRows;
|
||||
this.loader(false);
|
||||
options.onAfter();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/*
|
||||
* External API so that users can perform search programatically.
|
||||
* */
|
||||
this.search = function (submittedVal) {
|
||||
val = submittedVal;
|
||||
e.trigger();
|
||||
};
|
||||
|
||||
/*
|
||||
* External API to get the number of matched results as seen in
|
||||
* https://github.com/ruiz107/quicksearch/commit/f78dc440b42d95ce9caed1d087174dd4359982d6
|
||||
* */
|
||||
this.currentMatchedResults = function() {
|
||||
return this.matchedResultsCount;
|
||||
};
|
||||
|
||||
this.stripe = function () {
|
||||
|
||||
if (typeof options.stripeRows === "object" && options.stripeRows !== null)
|
||||
{
|
||||
var joined = options.stripeRows.join(' ');
|
||||
var stripeRows_length = options.stripeRows.length;
|
||||
|
||||
jq_results.not(':hidden').each(function (i) {
|
||||
$(this).removeClass(joined).addClass(options.stripeRows[i % stripeRows_length]);
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this.strip_html = function (input) {
|
||||
var output = input.replace(new RegExp('<[^<]+\>', 'g'), "");
|
||||
output = $.trim(output.toLowerCase());
|
||||
return output;
|
||||
};
|
||||
|
||||
this.results = function (bool) {
|
||||
if (typeof options.noResults === "string" && options.noResults !== "") {
|
||||
if (bool) {
|
||||
$(options.noResults).hide();
|
||||
} else {
|
||||
$(options.noResults).show();
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
this.loader = function (bool) {
|
||||
if (typeof options.loader === "string" && options.loader !== "") {
|
||||
(bool) ? $(options.loader).show() : $(options.loader).hide();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
this.cache = function () {
|
||||
|
||||
jq_results = $(target);
|
||||
|
||||
if (typeof options.noResults === "string" && options.noResults !== "") {
|
||||
jq_results = jq_results.not(options.noResults);
|
||||
}
|
||||
|
||||
var t = (typeof options.selector === "string") ? jq_results.find(options.selector) : $(target).not(options.noResults);
|
||||
cache = t.map(function () {
|
||||
return e.strip_html(this.innerHTML);
|
||||
});
|
||||
|
||||
rowcache = jq_results.map(function () {
|
||||
return this;
|
||||
});
|
||||
|
||||
/*
|
||||
* Modified fix for sync-ing "val".
|
||||
* Original fix https://github.com/michaellwest/quicksearch/commit/4ace4008d079298a01f97f885ba8fa956a9703d1
|
||||
* */
|
||||
val = val || this.val() || "";
|
||||
|
||||
return this.go();
|
||||
};
|
||||
|
||||
this.trigger = function () {
|
||||
this.loader(true);
|
||||
options.onBefore();
|
||||
|
||||
window.clearTimeout(timeout);
|
||||
timeout = window.setTimeout(function () {
|
||||
e.go();
|
||||
}, options.delay);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
this.cache();
|
||||
this.results(true);
|
||||
this.stripe();
|
||||
this.loader(false);
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
/*
|
||||
* Changed from .bind to .on.
|
||||
* */
|
||||
$(this).on(options.bind, function () {
|
||||
|
||||
val = $(this).val();
|
||||
e.trigger();
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}(jQuery, this, document));
|
||||
1538
public/js/ckeditor/CHANGES.md
Executable file
1538
public/js/ckeditor/CHANGES.md
Executable file
File diff suppressed because it is too large
Load Diff
1420
public/js/ckeditor/LICENSE.md
Executable file
1420
public/js/ckeditor/LICENSE.md
Executable file
File diff suppressed because it is too large
Load Diff
39
public/js/ckeditor/README.md
Executable file
39
public/js/ckeditor/README.md
Executable file
@@ -0,0 +1,39 @@
|
||||
CKEditor 4
|
||||
==========
|
||||
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
http://ckeditor.com - See LICENSE.md for license information.
|
||||
|
||||
CKEditor is a text editor to be used inside web pages. It's not a replacement
|
||||
for desktop text editors like Word or OpenOffice, but a component to be used as
|
||||
part of web applications and websites.
|
||||
|
||||
## Documentation
|
||||
|
||||
The full editor documentation is available online at the following address:
|
||||
http://docs.ckeditor.com
|
||||
|
||||
## Installation
|
||||
|
||||
Installing CKEditor is an easy task. Just follow these simple steps:
|
||||
|
||||
1. **Download** the latest version from the CKEditor website:
|
||||
http://ckeditor.com. You should have already completed this step, but be
|
||||
sure you have the very latest version.
|
||||
2. **Extract** (decompress) the downloaded file into the root of your website.
|
||||
|
||||
**Note:** CKEditor is by default installed in the `ckeditor` folder. You can
|
||||
place the files in whichever you want though.
|
||||
|
||||
## Checking Your Installation
|
||||
|
||||
The editor comes with a few sample pages that can be used to verify that
|
||||
installation proceeded properly. Take a look at the `samples` directory.
|
||||
|
||||
To test your installation, just call the following page at your website:
|
||||
|
||||
http://<your site>/<CKEditor installation path>/samples/index.html
|
||||
|
||||
For example:
|
||||
|
||||
http://www.example.com/ckeditor/samples/index.html
|
||||
10
public/js/ckeditor/adapters/jquery.js
vendored
Executable file
10
public/js/ckeditor/adapters/jquery.js
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
|
||||
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
|
||||
null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
|
||||
[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
|
||||
c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
|
||||
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);
|
||||
165
public/js/ckeditor/build-config.js
Executable file
165
public/js/ckeditor/build-config.js
Executable file
@@ -0,0 +1,165 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file was added automatically by CKEditor builder.
|
||||
* You may re-use it at any time to build CKEditor again.
|
||||
*
|
||||
* If you would like to build CKEditor online again
|
||||
* (for example to upgrade), visit one the following links:
|
||||
*
|
||||
* (1) http://ckeditor.com/builder
|
||||
* Visit online builder to build CKEditor from scratch.
|
||||
*
|
||||
* (2) http://ckeditor.com/builder/16ddcf88521eabc1fa981fc421ce7fe0
|
||||
* Visit online builder to build CKEditor, starting with the same setup as before.
|
||||
*
|
||||
* (3) http://ckeditor.com/builder/download/16ddcf88521eabc1fa981fc421ce7fe0
|
||||
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
|
||||
*
|
||||
* NOTE:
|
||||
* This file is not used by CKEditor, you may remove it.
|
||||
* Changing this file will not change your CKEditor configuration.
|
||||
*/
|
||||
|
||||
var CKBUILDER_CONFIG = {
|
||||
skin: 'moono-lisa',
|
||||
preset: 'standard',
|
||||
ignore: [
|
||||
'.DS_Store',
|
||||
'.bender',
|
||||
'.editorconfig',
|
||||
'.gitattributes',
|
||||
'.gitignore',
|
||||
'.idea',
|
||||
'.jscsrc',
|
||||
'.jshintignore',
|
||||
'.jshintrc',
|
||||
'.mailmap',
|
||||
'.travis.yml',
|
||||
'bender-err.log',
|
||||
'bender-out.log',
|
||||
'bender.ci.js',
|
||||
'bender.js',
|
||||
'dev',
|
||||
'gruntfile.js',
|
||||
'less',
|
||||
'node_modules',
|
||||
'package.json',
|
||||
'tests'
|
||||
],
|
||||
plugins : {
|
||||
'a11yhelp' : 1,
|
||||
'about' : 1,
|
||||
'basicstyles' : 1,
|
||||
'blockquote' : 1,
|
||||
'clipboard' : 1,
|
||||
'contextmenu' : 1,
|
||||
'elementspath' : 1,
|
||||
'enterkey' : 1,
|
||||
'entities' : 1,
|
||||
'filebrowser' : 1,
|
||||
'floatingspace' : 1,
|
||||
'format' : 1,
|
||||
'horizontalrule' : 1,
|
||||
'htmlwriter' : 1,
|
||||
'image' : 1,
|
||||
'indentlist' : 1,
|
||||
'link' : 1,
|
||||
'list' : 1,
|
||||
'magicline' : 1,
|
||||
'maximize' : 1,
|
||||
'pastefromword' : 1,
|
||||
'pastetext' : 1,
|
||||
'removeformat' : 1,
|
||||
'resize' : 1,
|
||||
'scayt' : 1,
|
||||
'showborders' : 1,
|
||||
'sourcearea' : 1,
|
||||
'specialchar' : 1,
|
||||
'stylescombo' : 1,
|
||||
'tab' : 1,
|
||||
'table' : 1,
|
||||
'tableselection' : 1,
|
||||
'tabletools' : 1,
|
||||
'toolbar' : 1,
|
||||
'undo' : 1,
|
||||
'uploadimage' : 1,
|
||||
'wsc' : 1,
|
||||
'wysiwygarea' : 1
|
||||
},
|
||||
languages : {
|
||||
'af' : 1,
|
||||
'ar' : 1,
|
||||
'az' : 1,
|
||||
'bg' : 1,
|
||||
'bn' : 1,
|
||||
'bs' : 1,
|
||||
'ca' : 1,
|
||||
'cs' : 1,
|
||||
'cy' : 1,
|
||||
'da' : 1,
|
||||
'de' : 1,
|
||||
'de-ch' : 1,
|
||||
'el' : 1,
|
||||
'en' : 1,
|
||||
'en-au' : 1,
|
||||
'en-ca' : 1,
|
||||
'en-gb' : 1,
|
||||
'eo' : 1,
|
||||
'es' : 1,
|
||||
'es-mx' : 1,
|
||||
'et' : 1,
|
||||
'eu' : 1,
|
||||
'fa' : 1,
|
||||
'fi' : 1,
|
||||
'fo' : 1,
|
||||
'fr' : 1,
|
||||
'fr-ca' : 1,
|
||||
'gl' : 1,
|
||||
'gu' : 1,
|
||||
'he' : 1,
|
||||
'hi' : 1,
|
||||
'hr' : 1,
|
||||
'hu' : 1,
|
||||
'id' : 1,
|
||||
'is' : 1,
|
||||
'it' : 1,
|
||||
'ja' : 1,
|
||||
'ka' : 1,
|
||||
'km' : 1,
|
||||
'ko' : 1,
|
||||
'ku' : 1,
|
||||
'lt' : 1,
|
||||
'lv' : 1,
|
||||
'mk' : 1,
|
||||
'mn' : 1,
|
||||
'ms' : 1,
|
||||
'nb' : 1,
|
||||
'nl' : 1,
|
||||
'no' : 1,
|
||||
'oc' : 1,
|
||||
'pl' : 1,
|
||||
'pt' : 1,
|
||||
'pt-br' : 1,
|
||||
'ro' : 1,
|
||||
'ru' : 1,
|
||||
'si' : 1,
|
||||
'sk' : 1,
|
||||
'sl' : 1,
|
||||
'sq' : 1,
|
||||
'sr' : 1,
|
||||
'sr-latn' : 1,
|
||||
'sv' : 1,
|
||||
'th' : 1,
|
||||
'tr' : 1,
|
||||
'tt' : 1,
|
||||
'ug' : 1,
|
||||
'uk' : 1,
|
||||
'vi' : 1,
|
||||
'zh' : 1,
|
||||
'zh-cn' : 1
|
||||
}
|
||||
};
|
||||
1216
public/js/ckeditor/ckeditor.js
vendored
Executable file
1216
public/js/ckeditor/ckeditor.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
38
public/js/ckeditor/config.js
Executable file
38
public/js/ckeditor/config.js
Executable file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
CKEDITOR.editorConfig = function( config ) {
|
||||
// Define changes to default configuration here.
|
||||
// For complete reference see:
|
||||
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
|
||||
|
||||
// The toolbar groups arrangement, optimized for two toolbar rows.
|
||||
config.toolbarGroups = [
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
||||
{ name: 'links' },
|
||||
{ name: 'insert' },
|
||||
{ name: 'forms' },
|
||||
{ name: 'tools' },
|
||||
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
||||
{ name: 'others' },
|
||||
'/',
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
|
||||
{ name: 'styles' },
|
||||
{ name: 'colors' },
|
||||
{ name: 'about' }
|
||||
];
|
||||
|
||||
// Remove some buttons provided by the standard plugins, which are
|
||||
// not needed in the Standard(s) toolbar.
|
||||
config.removeButtons = 'Underline,Subscript,Superscript';
|
||||
|
||||
// Set the most common block elements.
|
||||
config.format_tags = 'p;h1;h2;h3;pre';
|
||||
|
||||
// Simplify the dialog windows.
|
||||
config.removeDialogTabs = 'image:advanced;link:advanced';
|
||||
};
|
||||
208
public/js/ckeditor/contents.css
Executable file
208
public/js/ckeditor/contents.css
Executable file
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
body
|
||||
{
|
||||
/* Font */
|
||||
/* Emoji fonts are added to visualise them nicely in Internet Explorer. */
|
||||
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-size: 12px;
|
||||
|
||||
/* Text color */
|
||||
color: #333;
|
||||
|
||||
/* Remove the background color to make it transparent. */
|
||||
background-color: #fff;
|
||||
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.cke_editable
|
||||
{
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
|
||||
/* Fix for missing scrollbars with RTL texts. (#10488) */
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
blockquote
|
||||
{
|
||||
font-style: italic;
|
||||
font-family: Georgia, Times, "Times New Roman", serif;
|
||||
padding: 2px 0;
|
||||
border-style: solid;
|
||||
border-color: #ccc;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.cke_contents_ltr blockquote
|
||||
{
|
||||
padding-left: 20px;
|
||||
padding-right: 8px;
|
||||
border-left-width: 5px;
|
||||
}
|
||||
|
||||
.cke_contents_rtl blockquote
|
||||
{
|
||||
padding-left: 8px;
|
||||
padding-right: 20px;
|
||||
border-right-width: 5px;
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
color: #0782C1;
|
||||
}
|
||||
|
||||
ol,ul,dl
|
||||
{
|
||||
/* IE7: reset rtl list margin. (#7334) */
|
||||
*margin-right: 0px;
|
||||
/* Preserved spaces for list items with text direction different than the list. (#6249,#8049)*/
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6
|
||||
{
|
||||
font-weight: normal;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
border: 0px;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
|
||||
img.right
|
||||
{
|
||||
border: 1px solid #ccc;
|
||||
float: right;
|
||||
margin-left: 15px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
img.left
|
||||
{
|
||||
border: 1px solid #ccc;
|
||||
float: left;
|
||||
margin-right: 15px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
pre
|
||||
{
|
||||
white-space: pre-wrap; /* CSS 2.1 */
|
||||
word-wrap: break-word; /* IE7 */
|
||||
-moz-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
.marker
|
||||
{
|
||||
background-color: Yellow;
|
||||
}
|
||||
|
||||
span[lang]
|
||||
{
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
figure
|
||||
{
|
||||
text-align: center;
|
||||
outline: solid 1px #ccc;
|
||||
background: rgba(0,0,0,0.05);
|
||||
padding: 10px;
|
||||
margin: 10px 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
figure > figcaption
|
||||
{
|
||||
text-align: center;
|
||||
display: block; /* For IE8 */
|
||||
}
|
||||
|
||||
a > img {
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
border: none;
|
||||
outline: 1px solid #0782C1;
|
||||
}
|
||||
|
||||
/* Widget Styles */
|
||||
.code-featured
|
||||
{
|
||||
border: 5px solid red;
|
||||
}
|
||||
|
||||
.math-featured
|
||||
{
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 2px rgba(200, 0, 0, 1);
|
||||
background-color: rgba(255, 0, 0, 0.05);
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.image-clean
|
||||
{
|
||||
border: 0;
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.image-clean > figcaption
|
||||
{
|
||||
font-size: .9em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.image-grayscale
|
||||
{
|
||||
background-color: white;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.image-grayscale img, img.image-grayscale
|
||||
{
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
|
||||
.embed-240p
|
||||
{
|
||||
max-width: 426px;
|
||||
max-height: 240px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.embed-360p
|
||||
{
|
||||
max-width: 640px;
|
||||
max-height: 360px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.embed-480p
|
||||
{
|
||||
max-width: 854px;
|
||||
max-height: 480px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.embed-720p
|
||||
{
|
||||
max-width: 1280px;
|
||||
max-height: 720px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
.embed-1080p
|
||||
{
|
||||
max-width: 1920px;
|
||||
max-height: 1080px;
|
||||
margin:0 auto;
|
||||
}
|
||||
63
public/js/ckeditor/lang/_translationstatus.txt
Executable file
63
public/js/ckeditor/lang/_translationstatus.txt
Executable file
@@ -0,0 +1,63 @@
|
||||
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
|
||||
af.js Found: 62 Missing: 4
|
||||
ar.js Found: 51 Missing: 15
|
||||
bg.js Found: 58 Missing: 8
|
||||
bn.js Found: 40 Missing: 26
|
||||
bs.js Found: 29 Missing: 37
|
||||
ca.js Found: 61 Missing: 5
|
||||
cs.js Found: 66 Missing: 0
|
||||
cy.js Found: 66 Missing: 0
|
||||
da.js Found: 66 Missing: 0
|
||||
de.js Found: 66 Missing: 0
|
||||
el.js Found: 59 Missing: 7
|
||||
en-au.js Found: 38 Missing: 28
|
||||
en-ca.js Found: 37 Missing: 29
|
||||
en-gb.js Found: 61 Missing: 5
|
||||
eo.js Found: 66 Missing: 0
|
||||
es.js Found: 66 Missing: 0
|
||||
et.js Found: 66 Missing: 0
|
||||
eu.js Found: 48 Missing: 18
|
||||
fa.js Found: 66 Missing: 0
|
||||
fi.js Found: 66 Missing: 0
|
||||
fo.js Found: 66 Missing: 0
|
||||
fr-ca.js Found: 42 Missing: 24
|
||||
fr.js Found: 66 Missing: 0
|
||||
gl.js Found: 40 Missing: 26
|
||||
gu.js Found: 66 Missing: 0
|
||||
he.js Found: 66 Missing: 0
|
||||
hi.js Found: 43 Missing: 23
|
||||
hr.js Found: 66 Missing: 0
|
||||
hu.js Found: 63 Missing: 3
|
||||
is.js Found: 41 Missing: 25
|
||||
it.js Found: 66 Missing: 0
|
||||
ja.js Found: 62 Missing: 4
|
||||
ka.js Found: 62 Missing: 4
|
||||
km.js Found: 40 Missing: 26
|
||||
ko.js Found: 40 Missing: 26
|
||||
lt.js Found: 66 Missing: 0
|
||||
lv.js Found: 40 Missing: 26
|
||||
mk.js Found: 0 Missing: 66
|
||||
mn.js Found: 40 Missing: 26
|
||||
ms.js Found: 39 Missing: 27
|
||||
nb.js Found: 66 Missing: 0
|
||||
nl.js Found: 65 Missing: 1
|
||||
no.js Found: 66 Missing: 0
|
||||
pl.js Found: 66 Missing: 0
|
||||
pt-br.js Found: 66 Missing: 0
|
||||
pt.js Found: 52 Missing: 14
|
||||
ro.js Found: 61 Missing: 5
|
||||
ru.js Found: 66 Missing: 0
|
||||
sk.js Found: 49 Missing: 17
|
||||
sl.js Found: 48 Missing: 18
|
||||
sr-latn.js Found: 40 Missing: 26
|
||||
sr.js Found: 40 Missing: 26
|
||||
sv.js Found: 62 Missing: 4
|
||||
th.js Found: 40 Missing: 26
|
||||
tr.js Found: 66 Missing: 0
|
||||
ug.js Found: 66 Missing: 0
|
||||
uk.js Found: 66 Missing: 0
|
||||
vi.js Found: 66 Missing: 0
|
||||
zh-cn.js Found: 66 Missing: 0
|
||||
zh.js Found: 58 Missing: 8
|
||||
5
public/js/ckeditor/lang/af.js
Executable file
5
public/js/ckeditor/lang/af.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ar.js
Executable file
5
public/js/ckeditor/lang/ar.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/az.js
Executable file
5
public/js/ckeditor/lang/az.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/bg.js
Executable file
5
public/js/ckeditor/lang/bg.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/bn.js
Executable file
5
public/js/ckeditor/lang/bn.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/bs.js
Executable file
5
public/js/ckeditor/lang/bs.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ca.js
Executable file
5
public/js/ckeditor/lang/ca.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/cs.js
Executable file
5
public/js/ckeditor/lang/cs.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/cy.js
Executable file
5
public/js/ckeditor/lang/cy.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/da.js
Executable file
5
public/js/ckeditor/lang/da.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/de-ch.js
Executable file
5
public/js/ckeditor/lang/de-ch.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/de.js
Executable file
5
public/js/ckeditor/lang/de.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/el.js
Executable file
5
public/js/ckeditor/lang/el.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/en-au.js
Executable file
5
public/js/ckeditor/lang/en-au.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/en-ca.js
Executable file
5
public/js/ckeditor/lang/en-ca.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/en-gb.js
Executable file
5
public/js/ckeditor/lang/en-gb.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/en.js
Executable file
5
public/js/ckeditor/lang/en.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/eo.js
Executable file
5
public/js/ckeditor/lang/eo.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/es-mx.js
Executable file
5
public/js/ckeditor/lang/es-mx.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/es.js
Executable file
5
public/js/ckeditor/lang/es.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/et.js
Executable file
5
public/js/ckeditor/lang/et.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/eu.js
Executable file
5
public/js/ckeditor/lang/eu.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/fa.js
Executable file
5
public/js/ckeditor/lang/fa.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/fi.js
Executable file
5
public/js/ckeditor/lang/fi.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/fo.js
Executable file
5
public/js/ckeditor/lang/fo.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/fr-ca.js
Executable file
5
public/js/ckeditor/lang/fr-ca.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/fr.js
Executable file
5
public/js/ckeditor/lang/fr.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/gl.js
Executable file
5
public/js/ckeditor/lang/gl.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/gu.js
Executable file
5
public/js/ckeditor/lang/gu.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/he.js
Executable file
5
public/js/ckeditor/lang/he.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/hi.js
Executable file
5
public/js/ckeditor/lang/hi.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/hr.js
Executable file
5
public/js/ckeditor/lang/hr.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/hu.js
Executable file
5
public/js/ckeditor/lang/hu.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/id.js
Executable file
5
public/js/ckeditor/lang/id.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/is.js
Executable file
5
public/js/ckeditor/lang/is.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/it.js
Executable file
5
public/js/ckeditor/lang/it.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ja.js
Executable file
5
public/js/ckeditor/lang/ja.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ka.js
Executable file
5
public/js/ckeditor/lang/ka.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/km.js
Executable file
5
public/js/ckeditor/lang/km.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ko.js
Executable file
5
public/js/ckeditor/lang/ko.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ku.js
Executable file
5
public/js/ckeditor/lang/ku.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/lt.js
Executable file
5
public/js/ckeditor/lang/lt.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/lv.js
Executable file
5
public/js/ckeditor/lang/lv.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/mk.js
Executable file
5
public/js/ckeditor/lang/mk.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/mn.js
Executable file
5
public/js/ckeditor/lang/mn.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ms.js
Executable file
5
public/js/ckeditor/lang/ms.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/nb.js
Executable file
5
public/js/ckeditor/lang/nb.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/nl.js
Executable file
5
public/js/ckeditor/lang/nl.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/no.js
Executable file
5
public/js/ckeditor/lang/no.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/oc.js
Executable file
5
public/js/ckeditor/lang/oc.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/pl.js
Executable file
5
public/js/ckeditor/lang/pl.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/pt-br.js
Executable file
5
public/js/ckeditor/lang/pt-br.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/pt.js
Executable file
5
public/js/ckeditor/lang/pt.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ro.js
Executable file
5
public/js/ckeditor/lang/ro.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ru.js
Executable file
5
public/js/ckeditor/lang/ru.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/si.js
Executable file
5
public/js/ckeditor/lang/si.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sk.js
Executable file
5
public/js/ckeditor/lang/sk.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sl.js
Executable file
5
public/js/ckeditor/lang/sl.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sq.js
Executable file
5
public/js/ckeditor/lang/sq.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sr-latn.js
Executable file
5
public/js/ckeditor/lang/sr-latn.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sr.js
Executable file
5
public/js/ckeditor/lang/sr.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/sv.js
Executable file
5
public/js/ckeditor/lang/sv.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/th.js
Executable file
5
public/js/ckeditor/lang/th.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/tr.js
Executable file
5
public/js/ckeditor/lang/tr.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/tt.js
Executable file
5
public/js/ckeditor/lang/tt.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/ug.js
Executable file
5
public/js/ckeditor/lang/ug.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/uk.js
Executable file
5
public/js/ckeditor/lang/uk.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/vi.js
Executable file
5
public/js/ckeditor/lang/vi.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/zh-cn.js
Executable file
5
public/js/ckeditor/lang/zh-cn.js
Executable file
File diff suppressed because one or more lines are too long
5
public/js/ckeditor/lang/zh.js
Executable file
5
public/js/ckeditor/lang/zh.js
Executable file
File diff suppressed because one or more lines are too long
85
public/js/ckeditor/old/ajax.html
Executable file
85
public/js/ckeditor/old/ajax.html
Executable file
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Ajax — CKEditor Sample</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<link rel="stylesheet" href="sample.css">
|
||||
<script>
|
||||
|
||||
var editor, html = '';
|
||||
|
||||
function createEditor() {
|
||||
if ( editor )
|
||||
return;
|
||||
|
||||
// Create a new editor inside the <div id="editor">, setting its value to html
|
||||
var config = {};
|
||||
editor = CKEDITOR.appendTo( 'editor', config, html );
|
||||
}
|
||||
|
||||
function removeEditor() {
|
||||
if ( !editor )
|
||||
return;
|
||||
|
||||
// Retrieve the editor contents. In an Ajax application, this data would be
|
||||
// sent to the server or used in any other way.
|
||||
document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
|
||||
document.getElementById( 'contents' ).style.display = '';
|
||||
|
||||
// Destroy the editor.
|
||||
editor.destroy();
|
||||
editor = null;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="index.html">CKEditor Samples</a> » Create and Destroy Editor Instances for Ajax Applications
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out its <a href="https://sdk.ckeditor.com/samples/saveajax.html">brand new version in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
|
||||
area will be displayed in a <code><div></code> element.
|
||||
</p>
|
||||
<p>
|
||||
For details of how to create this setup check the source code of this sample page
|
||||
for JavaScript code responsible for the creation and destruction of a CKEditor instance.
|
||||
</p>
|
||||
</div>
|
||||
<p>Click the buttons to create and remove a CKEditor instance.</p>
|
||||
<p>
|
||||
<input onclick="createEditor();" type="button" value="Create Editor">
|
||||
<input onclick="removeEditor();" type="button" value="Remove Editor">
|
||||
</p>
|
||||
<!-- This div will hold the editor. -->
|
||||
<div id="editor">
|
||||
</div>
|
||||
<div id="contents" style="display: none">
|
||||
<p>
|
||||
Edited Contents:
|
||||
</p>
|
||||
<!-- This div will be used to display the editor contents. -->
|
||||
<div id="editorcontents">
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
210
public/js/ckeditor/old/api.html
Executable file
210
public/js/ckeditor/old/api.html
Executable file
@@ -0,0 +1,210 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>API Usage — CKEditor Sample</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<link href="sample.css" rel="stylesheet">
|
||||
<script>
|
||||
|
||||
// The instanceReady event is fired, when an instance of CKEditor has finished
|
||||
// its initialization.
|
||||
CKEDITOR.on( 'instanceReady', function( ev ) {
|
||||
// Show the editor name and description in the browser status bar.
|
||||
document.getElementById( 'eMessage' ).innerHTML = 'Instance <code>' + ev.editor.name + '<\/code> loaded.';
|
||||
|
||||
// Show this sample buttons.
|
||||
document.getElementById( 'eButtons' ).style.display = 'block';
|
||||
});
|
||||
|
||||
function InsertHTML() {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
var value = document.getElementById( 'htmlArea' ).value;
|
||||
|
||||
// Check the active editing mode.
|
||||
if ( editor.mode == 'wysiwyg' )
|
||||
{
|
||||
// Insert HTML code.
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-insertHtml
|
||||
editor.insertHtml( value );
|
||||
}
|
||||
else
|
||||
alert( 'You must be in WYSIWYG mode!' );
|
||||
}
|
||||
|
||||
function InsertText() {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
var value = document.getElementById( 'txtArea' ).value;
|
||||
|
||||
// Check the active editing mode.
|
||||
if ( editor.mode == 'wysiwyg' )
|
||||
{
|
||||
// Insert as plain text.
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-insertText
|
||||
editor.insertText( value );
|
||||
}
|
||||
else
|
||||
alert( 'You must be in WYSIWYG mode!' );
|
||||
}
|
||||
|
||||
function SetContents() {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
var value = document.getElementById( 'htmlArea' ).value;
|
||||
|
||||
// Set editor contents (replace current contents).
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-setData
|
||||
editor.setData( value );
|
||||
}
|
||||
|
||||
function GetContents() {
|
||||
// Get the editor instance that you want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
|
||||
// Get editor contents
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-getData
|
||||
alert( editor.getData() );
|
||||
}
|
||||
|
||||
function ExecuteCommand( commandName ) {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
|
||||
// Check the active editing mode.
|
||||
if ( editor.mode == 'wysiwyg' )
|
||||
{
|
||||
// Execute the command.
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-execCommand
|
||||
editor.execCommand( commandName );
|
||||
}
|
||||
else
|
||||
alert( 'You must be in WYSIWYG mode!' );
|
||||
}
|
||||
|
||||
function CheckDirty() {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
// Checks whether the current editor contents present changes when compared
|
||||
// to the contents loaded into the editor at startup
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-checkDirty
|
||||
alert( editor.checkDirty() );
|
||||
}
|
||||
|
||||
function ResetDirty() {
|
||||
// Get the editor instance that we want to interact with.
|
||||
var editor = CKEDITOR.instances.editor1;
|
||||
// Resets the "dirty state" of the editor (see CheckDirty())
|
||||
// https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-resetDirty
|
||||
editor.resetDirty();
|
||||
alert( 'The "IsDirty" status has been reset' );
|
||||
}
|
||||
|
||||
function Focus() {
|
||||
CKEDITOR.instances.editor1.focus();
|
||||
}
|
||||
|
||||
function onFocus() {
|
||||
document.getElementById( 'eMessage' ).innerHTML = '<b>' + this.name + ' is focused </b>';
|
||||
}
|
||||
|
||||
function onBlur() {
|
||||
document.getElementById( 'eMessage' ).innerHTML = this.name + ' lost focus';
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="index.html">CKEditor Samples</a> » Using CKEditor JavaScript API
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out its <a href="https://sdk.ckeditor.com/samples/api.html">brand new version in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
This sample shows how to use the
|
||||
<a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor">CKEditor JavaScript API</a>
|
||||
to interact with the editor at runtime.
|
||||
</p>
|
||||
<p>
|
||||
For details on how to create this setup check the source code of this sample page.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- This <div> holds alert messages to be display in the sample page. -->
|
||||
<div id="alerts">
|
||||
<noscript>
|
||||
<p>
|
||||
<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
|
||||
support, like yours, you should still see the contents (HTML data) and you should
|
||||
be able to edit it normally, without a rich editor interface.
|
||||
</p>
|
||||
</noscript>
|
||||
</div>
|
||||
<form action="../../../samples/sample_posteddata.php" method="post">
|
||||
<textarea cols="100" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</p></textarea>
|
||||
|
||||
<script>
|
||||
// Replace the <textarea id="editor1"> with an CKEditor instance.
|
||||
CKEDITOR.replace( 'editor1', {
|
||||
on: {
|
||||
focus: onFocus,
|
||||
blur: onBlur,
|
||||
|
||||
// Check for availability of corresponding plugins.
|
||||
pluginsLoaded: function( evt ) {
|
||||
var doc = CKEDITOR.document, ed = evt.editor;
|
||||
if ( !ed.getCommand( 'bold' ) )
|
||||
doc.getById( 'exec-bold' ).hide();
|
||||
if ( !ed.getCommand( 'link' ) )
|
||||
doc.getById( 'exec-link' ).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<p id="eMessage">
|
||||
</p>
|
||||
|
||||
<div id="eButtons" style="display: none">
|
||||
<input id="exec-bold" onclick="ExecuteCommand('bold');" type="button" value="Execute "bold" Command">
|
||||
<input id="exec-link" onclick="ExecuteCommand('link');" type="button" value="Execute "link" Command">
|
||||
<input onclick="Focus();" type="button" value="Focus">
|
||||
<br><br>
|
||||
<input onclick="InsertHTML();" type="button" value="Insert HTML">
|
||||
<input onclick="SetContents();" type="button" value="Set Editor Contents">
|
||||
<input onclick="GetContents();" type="button" value="Get Editor Contents (HTML)">
|
||||
<br>
|
||||
<textarea cols="100" id="htmlArea" rows="3"><h2>Test</h2><p>This is some <a href="/Test1.html">sample</a> HTML code.</p></textarea>
|
||||
<br>
|
||||
<br>
|
||||
<input onclick="InsertText();" type="button" value="Insert Text">
|
||||
<br>
|
||||
<textarea cols="100" id="txtArea" rows="3"> First line with some leading whitespaces.
|
||||
|
||||
Second line of text preceded by two line breaks.</textarea>
|
||||
<br>
|
||||
<br>
|
||||
<input onclick="CheckDirty();" type="button" value="checkDirty()">
|
||||
<input onclick="ResetDirty();" type="button" value="resetDirty()">
|
||||
</div>
|
||||
</form>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
59
public/js/ckeditor/old/appendto.html
Executable file
59
public/js/ckeditor/old/appendto.html
Executable file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Append To Page Element Using JavaScript Code — CKEditor Sample</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<link rel="stylesheet" href="sample.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="index.html">CKEditor Samples</a> » Append To Page Element Using JavaScript Code
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out the <a href="https://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div id="section1">
|
||||
<div class="description">
|
||||
<p>
|
||||
The <code><a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR-method-appendTo">CKEDITOR.appendTo()</a></code> method serves to to place editors inside existing DOM elements. Unlike <code><a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR-method-replace">CKEDITOR.replace()</a></code>,
|
||||
a target container to be replaced is no longer necessary. A new editor
|
||||
instance is inserted directly wherever it is desired.
|
||||
</p>
|
||||
<pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>',
|
||||
{ /* Configuration options to be used. */ }
|
||||
'Editor content to be used.'
|
||||
);</pre>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
// This call can be placed at any point after the
|
||||
// DOM element to append CKEditor to or inside the <head><script>
|
||||
// in a window.onload event handler.
|
||||
|
||||
// Append a CKEditor instance using the default configuration and the
|
||||
// provided content to the <div> element of ID "section1".
|
||||
CKEDITOR.appendTo( 'section1',
|
||||
null,
|
||||
'<p>This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</p>'
|
||||
);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<br>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
public/js/ckeditor/old/assets/inlineall/logo.png
Executable file
BIN
public/js/ckeditor/old/assets/inlineall/logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
204
public/js/ckeditor/old/assets/outputxhtml/outputxhtml.css
Executable file
204
public/js/ckeditor/old/assets/outputxhtml/outputxhtml.css
Executable file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*
|
||||
* Styles used by the XHTML 1.1 sample page (xhtml.html).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Basic definitions for the editing area.
|
||||
*/
|
||||
body
|
||||
{
|
||||
font-family: Arial, Verdana, sans-serif;
|
||||
font-size: 80%;
|
||||
color: #000000;
|
||||
background-color: #ffffff;
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Core styles.
|
||||
*/
|
||||
|
||||
.Bold
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.Italic
|
||||
{
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.Underline
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.StrikeThrough
|
||||
{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.Subscript
|
||||
{
|
||||
vertical-align: sub;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.Superscript
|
||||
{
|
||||
vertical-align: super;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Font faces.
|
||||
*/
|
||||
|
||||
.FontComic
|
||||
{
|
||||
font-family: 'Comic Sans MS';
|
||||
}
|
||||
|
||||
.FontCourier
|
||||
{
|
||||
font-family: 'Courier New';
|
||||
}
|
||||
|
||||
.FontTimes
|
||||
{
|
||||
font-family: 'Times New Roman';
|
||||
}
|
||||
|
||||
/**
|
||||
* Font sizes.
|
||||
*/
|
||||
|
||||
.FontSmaller
|
||||
{
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.FontLarger
|
||||
{
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
.FontSmall
|
||||
{
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.FontBig
|
||||
{
|
||||
font-size: 14pt;
|
||||
}
|
||||
|
||||
.FontDouble
|
||||
{
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Font colors.
|
||||
*/
|
||||
.FontColor1
|
||||
{
|
||||
color: #ff9900;
|
||||
}
|
||||
|
||||
.FontColor2
|
||||
{
|
||||
color: #0066cc;
|
||||
}
|
||||
|
||||
.FontColor3
|
||||
{
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
.FontColor1BG
|
||||
{
|
||||
background-color: #ff9900;
|
||||
}
|
||||
|
||||
.FontColor2BG
|
||||
{
|
||||
background-color: #0066cc;
|
||||
}
|
||||
|
||||
.FontColor3BG
|
||||
{
|
||||
background-color: #ff0000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indentation.
|
||||
*/
|
||||
|
||||
.Indent1
|
||||
{
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.Indent2
|
||||
{
|
||||
margin-left: 80px;
|
||||
}
|
||||
|
||||
.Indent3
|
||||
{
|
||||
margin-left: 120px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alignment.
|
||||
*/
|
||||
|
||||
.JustifyLeft
|
||||
{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.JustifyRight
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.JustifyCenter
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.JustifyFull
|
||||
{
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
/**
|
||||
* Other.
|
||||
*/
|
||||
|
||||
code
|
||||
{
|
||||
font-family: courier, monospace;
|
||||
background-color: #eeeeee;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
border: #c0c0c0 1px solid;
|
||||
}
|
||||
|
||||
kbd
|
||||
{
|
||||
padding: 0px 1px 0px 1px;
|
||||
border-width: 1px 2px 2px 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
blockquote
|
||||
{
|
||||
color: #808080;
|
||||
}
|
||||
59
public/js/ckeditor/old/assets/posteddata.php
Executable file
59
public/js/ckeditor/old/assets/posteddata.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<?php
|
||||
/*
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Sample — CKEditor</title>
|
||||
<link rel="stylesheet" href="sample.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
CKEditor — Posted Data
|
||||
</h1>
|
||||
<table border="1" cellspacing="0" id="outputSample">
|
||||
<colgroup><col width="120"></colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field Name</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
|
||||
if (!empty($_POST))
|
||||
{
|
||||
foreach ( $_POST as $key => $value )
|
||||
{
|
||||
if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
|
||||
continue;
|
||||
|
||||
if ( get_magic_quotes_gpc() )
|
||||
$value = htmlspecialchars( stripslashes((string)$value) );
|
||||
else
|
||||
$value = htmlspecialchars( (string)$value );
|
||||
?>
|
||||
<tr>
|
||||
<th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th>
|
||||
<td><pre class="samples"><?php echo $value; ?></pre></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
public/js/ckeditor/old/assets/sample.jpg
Executable file
BIN
public/js/ckeditor/old/assets/sample.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
7
public/js/ckeditor/old/assets/uilanguages/languages.js
Executable file
7
public/js/ckeditor/old/assets/uilanguages/languages.js
Executable file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
var CKEDITOR_LANGS=function(){var c={af:"Afrikaans",ar:"Arabic",az:"Azerbaijani",bg:"Bulgarian",bn:"Bengali/Bangla",bs:"Bosnian",ca:"Catalan",cs:"Czech",cy:"Welsh",da:"Danish",de:"German","de-ch":"German (Switzerland)",el:"Greek",en:"English","en-au":"English (Australia)","en-ca":"English (Canadian)","en-gb":"English (United Kingdom)",eo:"Esperanto",es:"Spanish","es-mx":"Spanish (Mexico)",et:"Estonian",eu:"Basque",fa:"Persian",fi:"Finnish",fo:"Faroese",fr:"French","fr-ca":"French (Canada)",gl:"Galician",
|
||||
gu:"Gujarati",he:"Hebrew",hi:"Hindi",hr:"Croatian",hu:"Hungarian",id:"Indonesian",is:"Icelandic",it:"Italian",ja:"Japanese",ka:"Georgian",km:"Khmer",ko:"Korean",ku:"Kurdish",lt:"Lithuanian",lv:"Latvian",mk:"Macedonian",mn:"Mongolian",ms:"Malay",nb:"Norwegian Bokmal",nl:"Dutch",no:"Norwegian",oc:"Occitan",pl:"Polish",pt:"Portuguese (Portugal)","pt-br":"Portuguese (Brazil)",ro:"Romanian",ru:"Russian",si:"Sinhala",sk:"Slovak",sq:"Albanian",sl:"Slovenian",sr:"Serbian (Cyrillic)","sr-latn":"Serbian (Latin)",
|
||||
sv:"Swedish",th:"Thai",tr:"Turkish",tt:"Tatar",ug:"Uighur",uk:"Ukrainian",vi:"Vietnamese",zh:"Chinese Traditional","zh-cn":"Chinese Simplified"},b=[],a;for(a in CKEDITOR.lang.languages)b.push({code:a,name:c[a]||a});b.sort(function(a,b){return a.name<b.name?-1:1});return b}();
|
||||
508
public/js/ckeditor/old/datafiltering.html
Executable file
508
public/js/ckeditor/old/datafiltering.html
Executable file
File diff suppressed because one or more lines are too long
48
public/js/ckeditor/old/dialog/assets/my_dialog.js
Executable file
48
public/js/ckeditor/old/dialog/assets/my_dialog.js
Executable file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
CKEDITOR.dialog.add( 'myDialog', function() {
|
||||
return {
|
||||
title: 'My Dialog',
|
||||
minWidth: 400,
|
||||
minHeight: 200,
|
||||
contents: [
|
||||
{
|
||||
id: 'tab1',
|
||||
label: 'First Tab',
|
||||
title: 'First Tab',
|
||||
elements: [
|
||||
{
|
||||
id: 'input1',
|
||||
type: 'text',
|
||||
label: 'Text Field'
|
||||
},
|
||||
{
|
||||
id: 'select1',
|
||||
type: 'select',
|
||||
label: 'Select Field',
|
||||
items: [
|
||||
[ 'option1', 'value1' ],
|
||||
[ 'option2', 'value2' ]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'tab2',
|
||||
label: 'Second Tab',
|
||||
title: 'Second Tab',
|
||||
elements: [
|
||||
{
|
||||
id: 'button1',
|
||||
type: 'button',
|
||||
label: 'Button Field'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
} );
|
||||
|
||||
190
public/js/ckeditor/old/dialog/dialog.html
Executable file
190
public/js/ckeditor/old/dialog/dialog.html
Executable file
@@ -0,0 +1,190 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Using API to Customize Dialog Windows — CKEditor Sample</title>
|
||||
<script src="../../../ckeditor.js"></script>
|
||||
<link rel="stylesheet" href="../../../samples/old/sample.css">
|
||||
<meta name="ckeditor-sample-name" content="Using the JavaScript API to customize dialog windows">
|
||||
<meta name="ckeditor-sample-group" content="Advanced Samples">
|
||||
<meta name="ckeditor-sample-description" content="Using the dialog windows API to customize dialog windows without changing the original editor code.">
|
||||
<style>
|
||||
|
||||
.cke_button__mybutton_icon
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.cke_button__mybutton_label
|
||||
{
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
|
||||
CKEDITOR.on( 'instanceCreated', function( ev ){
|
||||
var editor = ev.editor;
|
||||
|
||||
// Listen for the "pluginsLoaded" event, so we are sure that the
|
||||
// "dialog" plugin has been loaded and we are able to do our
|
||||
// customizations.
|
||||
editor.on( 'pluginsLoaded', function() {
|
||||
|
||||
// If our custom dialog has not been registered, do that now.
|
||||
if ( !CKEDITOR.dialog.exists( 'myDialog' ) ) {
|
||||
// We need to do the following trick to find out the dialog
|
||||
// definition file URL path. In the real world, you would simply
|
||||
// point to an absolute path directly, like "/mydir/mydialog.js".
|
||||
var href = document.location.href.split( '/' );
|
||||
href.pop();
|
||||
href.push( 'assets/my_dialog.js' );
|
||||
href = href.join( '/' );
|
||||
|
||||
// Finally, register the dialog.
|
||||
CKEDITOR.dialog.add( 'myDialog', href );
|
||||
}
|
||||
|
||||
// Register the command used to open the dialog.
|
||||
editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
|
||||
|
||||
// Add the a custom toolbar buttons, which fires the above
|
||||
// command..
|
||||
editor.ui.add( 'MyButton', CKEDITOR.UI_BUTTON, {
|
||||
label: 'My Dialog',
|
||||
command: 'myDialogCmd'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// When opening a dialog, its "definition" is created for it, for
|
||||
// each editor instance. The "dialogDefinition" event is then
|
||||
// fired. We should use this event to make customizations to the
|
||||
// definition of existing dialogs.
|
||||
CKEDITOR.on( 'dialogDefinition', function( ev ) {
|
||||
// Take the dialog name and its definition from the event data.
|
||||
var dialogName = ev.data.name;
|
||||
var dialogDefinition = ev.data.definition;
|
||||
|
||||
// Check if the definition is from the dialog we're
|
||||
// interested on (the "Link" dialog).
|
||||
if ( dialogName == 'myDialog' && ev.editor.name == 'editor2' ) {
|
||||
// Get a reference to the "Link Info" tab.
|
||||
var infoTab = dialogDefinition.getContents( 'tab1' );
|
||||
|
||||
// Add a new text field to the "tab1" tab page.
|
||||
infoTab.add( {
|
||||
type: 'text',
|
||||
label: 'My Custom Field',
|
||||
id: 'customField',
|
||||
'default': 'Sample!',
|
||||
validate: function() {
|
||||
if ( ( /\d/ ).test( this.getValue() ) )
|
||||
return 'My Custom Field must not contain digits';
|
||||
}
|
||||
});
|
||||
|
||||
// Remove the "select1" field from the "tab1" tab.
|
||||
infoTab.remove( 'select1' );
|
||||
|
||||
// Set the default value for "input1" field.
|
||||
var input1 = infoTab.get( 'input1' );
|
||||
input1[ 'default' ] = 'www.example.com';
|
||||
|
||||
// Remove the "tab2" tab page.
|
||||
dialogDefinition.removeContents( 'tab2' );
|
||||
|
||||
// Add a new tab to the "Link" dialog.
|
||||
dialogDefinition.addContents( {
|
||||
id: 'customTab',
|
||||
label: 'My Tab',
|
||||
accessKey: 'M',
|
||||
elements: [
|
||||
{
|
||||
id: 'myField1',
|
||||
type: 'text',
|
||||
label: 'My Text Field'
|
||||
},
|
||||
{
|
||||
id: 'myField2',
|
||||
type: 'text',
|
||||
label: 'Another Text Field'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Provide the focus handler to start initial focus in "customField" field.
|
||||
dialogDefinition.onFocus = function() {
|
||||
var urlField = this.getContentElement( 'tab1', 'customField' );
|
||||
urlField.select();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var config = {
|
||||
extraPlugins: 'dialog',
|
||||
toolbar: [ [ 'MyButton' ] ]
|
||||
};
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="../../../samples/old/index.html">CKEditor Samples</a> » Using CKEditor Dialog API
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out the <a href="https://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
This sample shows how to use the
|
||||
<a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dialog">CKEditor Dialog API</a>
|
||||
to customize CKEditor dialog windows without changing the original editor code.
|
||||
The following customizations are being done in the example below:
|
||||
</p>
|
||||
<p>
|
||||
For details on how to create this setup check the source code of this sample page.
|
||||
</p>
|
||||
</div>
|
||||
<p>A custom dialog is added to the editors using the <code>pluginsLoaded</code> event, from an external <a target="_blank" href="assets/my_dialog.js">dialog definition file</a>:</p>
|
||||
<ol>
|
||||
<li><strong>Creating a custom dialog window</strong> – "My Dialog" dialog window opened with the "My Dialog" toolbar button.</li>
|
||||
<li><strong>Creating a custom button</strong> – Add button to open the dialog with "My Dialog" toolbar button.</li>
|
||||
</ol>
|
||||
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</p></textarea>
|
||||
<script>
|
||||
// Replace the <textarea id="editor1"> with an CKEditor instance.
|
||||
CKEDITOR.replace( 'editor1', config );
|
||||
</script>
|
||||
<p>The below editor modify the dialog definition of the above added dialog using the <code>dialogDefinition</code> event:</p>
|
||||
<ol>
|
||||
<li><strong>Adding dialog tab</strong> – Add new tab "My Tab" to dialog window.</li>
|
||||
<li><strong>Removing a dialog window tab</strong> – Remove "Second Tab" page from the dialog window.</li>
|
||||
<li><strong>Adding dialog window fields</strong> – Add "My Custom Field" to the dialog window.</li>
|
||||
<li><strong>Removing dialog window field</strong> – Remove "Select Field" selection field from the dialog window.</li>
|
||||
<li><strong>Setting default values for dialog window fields</strong> – Set default value of "Text Field" text field. </li>
|
||||
<li><strong>Setup initial focus for dialog window</strong> – Put initial focus on "My Custom Field" text field. </li>
|
||||
</ol>
|
||||
<textarea cols="80" id="editor2" name="editor2" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</p></textarea>
|
||||
<script>
|
||||
|
||||
// Replace the <textarea id="editor1"> with an CKEditor instance.
|
||||
CKEDITOR.replace( 'editor2', config );
|
||||
|
||||
</script>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
144
public/js/ckeditor/old/divreplace.html
Executable file
144
public/js/ckeditor/old/divreplace.html
Executable file
@@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Replace DIV — CKEditor Sample</title>
|
||||
<script src="../../ckeditor.js"></script>
|
||||
<link href="sample.css" rel="stylesheet">
|
||||
<style>
|
||||
|
||||
div.editable
|
||||
{
|
||||
border: solid 2px transparent;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
div.editable:hover
|
||||
{
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
|
||||
// Uncomment the following code to test the "Timeout Loading Method".
|
||||
// CKEDITOR.loadFullCoreTimeout = 5;
|
||||
|
||||
window.onload = function() {
|
||||
// Listen to the double click event.
|
||||
if ( window.addEventListener )
|
||||
document.body.addEventListener( 'dblclick', onDoubleClick, false );
|
||||
else if ( window.attachEvent )
|
||||
document.body.attachEvent( 'ondblclick', onDoubleClick );
|
||||
|
||||
};
|
||||
|
||||
function onDoubleClick( ev ) {
|
||||
// Get the element which fired the event. This is not necessarily the
|
||||
// element to which the event has been attached.
|
||||
var element = ev.target || ev.srcElement;
|
||||
|
||||
// Find out the div that holds this element.
|
||||
var name;
|
||||
|
||||
do {
|
||||
element = element.parentNode;
|
||||
}
|
||||
while ( element && ( name = element.nodeName.toLowerCase() ) &&
|
||||
( name != 'div' || element.className.indexOf( 'editable' ) == -1 ) && name != 'body' );
|
||||
|
||||
if ( name == 'div' && element.className.indexOf( 'editable' ) != -1 )
|
||||
replaceDiv( element );
|
||||
}
|
||||
|
||||
var editor;
|
||||
|
||||
function replaceDiv( div ) {
|
||||
if ( editor )
|
||||
editor.destroy();
|
||||
|
||||
editor = CKEDITOR.replace( div );
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="index.html">CKEditor Samples</a> » Replace DIV with CKEditor on the Fly
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out the <a href="https://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
This sample shows how to automatically replace <code><div></code> elements
|
||||
with a CKEditor instance on the fly, following user's doubleclick. The content
|
||||
that was previously placed inside the <code><div></code> element will now
|
||||
be moved into CKEditor editing area.
|
||||
</p>
|
||||
<p>
|
||||
For details on how to create this setup check the source code of this sample page.
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
Double-click any of the following <code><div></code> elements to transform them into
|
||||
editor instances.
|
||||
</p>
|
||||
<div class="editable">
|
||||
<h3>
|
||||
Part 1
|
||||
</h3>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
||||
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
||||
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
||||
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
||||
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
||||
</p>
|
||||
</div>
|
||||
<div class="editable">
|
||||
<h3>
|
||||
Part 2
|
||||
</h3>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
||||
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
||||
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
||||
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
||||
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
||||
</p>
|
||||
<p>
|
||||
Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus
|
||||
sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum
|
||||
vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.
|
||||
</p>
|
||||
</div>
|
||||
<div class="editable">
|
||||
<h3>
|
||||
Part 3
|
||||
</h3>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
||||
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
||||
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
||||
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
||||
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
||||
</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
106
public/js/ckeditor/old/enterkey/enterkey.html
Executable file
106
public/js/ckeditor/old/enterkey/enterkey.html
Executable file
@@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ENTER Key Configuration — CKEditor Sample</title>
|
||||
<script src="../../../ckeditor.js"></script>
|
||||
<link href="../../../samples/old/sample.css" rel="stylesheet">
|
||||
<meta name="ckeditor-sample-name" content="Using the "Enter" key in CKEditor">
|
||||
<meta name="ckeditor-sample-group" content="Advanced Samples">
|
||||
<meta name="ckeditor-sample-description" content="Configuring the behavior of <em>Enter</em> and <em>Shift+Enter</em> keys.">
|
||||
<script>
|
||||
|
||||
var editor;
|
||||
|
||||
function changeEnter() {
|
||||
// If we already have an editor, let's destroy it first.
|
||||
if ( editor )
|
||||
editor.destroy( true );
|
||||
|
||||
// Create the editor again, with the appropriate settings.
|
||||
editor = CKEDITOR.replace( 'editor1', {
|
||||
extraPlugins: 'enterkey',
|
||||
enterMode: Number( document.getElementById( 'xEnter' ).value ),
|
||||
shiftEnterMode: Number( document.getElementById( 'xShiftEnter' ).value )
|
||||
});
|
||||
}
|
||||
|
||||
window.onload = changeEnter;
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="samples">
|
||||
<a href="../../../samples/old/index.html">CKEditor Samples</a> » ENTER Key Configuration
|
||||
</h1>
|
||||
<div class="warning deprecated">
|
||||
This sample is not maintained anymore. Check out its <a href="https://sdk.ckeditor.com/samples/enterkey.html">brand new version in CKEditor SDK</a>.
|
||||
</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
This sample shows how to configure the <em>Enter</em> and <em>Shift+Enter</em> keys
|
||||
to perform actions specified in the
|
||||
<a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-enterMode"><code>enterMode</code></a>
|
||||
and <a class="samples" href="https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-shiftEnterMode"><code>shiftEnterMode</code></a>
|
||||
parameters, respectively.
|
||||
You can choose from the following options:
|
||||
</p>
|
||||
<ul class="samples">
|
||||
<li><strong><code>ENTER_P</code></strong> – new <code><p></code> paragraphs are created;</li>
|
||||
<li><strong><code>ENTER_BR</code></strong> – lines are broken with <code><br></code> elements;</li>
|
||||
<li><strong><code>ENTER_DIV</code></strong> – new <code><div></code> blocks are created.</li>
|
||||
</ul>
|
||||
<p>
|
||||
The sample code below shows how to configure CKEditor to create a <code><div></code> block when <em>Enter</em> key is pressed.
|
||||
</p>
|
||||
<pre class="samples">
|
||||
CKEDITOR.replace( '<em>textarea_id</em>', {
|
||||
<strong>enterMode: CKEDITOR.ENTER_DIV</strong>
|
||||
});</pre>
|
||||
<p>
|
||||
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
|
||||
the <code><textarea></code> element to be replaced.
|
||||
</p>
|
||||
</div>
|
||||
<div style="float: left; margin-right: 20px">
|
||||
When <em>Enter</em> is pressed:<br>
|
||||
<select id="xEnter" onchange="changeEnter();">
|
||||
<option selected="selected" value="1">Create a new <P> (recommended)</option>
|
||||
<option value="3">Create a new <DIV></option>
|
||||
<option value="2">Break the line with a <BR></option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="float: left">
|
||||
When <em>Shift+Enter</em> is pressed:<br>
|
||||
<select id="xShiftEnter" onchange="changeEnter();">
|
||||
<option value="1">Create a new <P></option>
|
||||
<option value="3">Create a new <DIV></option>
|
||||
<option selected="selected" value="2">Break the line with a <BR> (recommended)</option>
|
||||
</select>
|
||||
</div>
|
||||
<br style="clear: both">
|
||||
<form action="../../../samples/sample_posteddata.php" method="post">
|
||||
<p>
|
||||
<br>
|
||||
<textarea cols="80" id="editor1" name="editor1" rows="10">This is some <strong>sample text</strong>. You are using <a href="https://ckeditor.com/">CKEditor</a>.</textarea>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Submit">
|
||||
</p>
|
||||
</form>
|
||||
<div id="footer">
|
||||
<hr>
|
||||
<p>
|
||||
CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
|
||||
</p>
|
||||
<p id="copy">
|
||||
Copyright © 2003-2017, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
|
||||
Knabben. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
public/js/ckeditor/old/htmlwriter/assets/outputforflash/outputforflash.fla
Executable file
BIN
public/js/ckeditor/old/htmlwriter/assets/outputforflash/outputforflash.fla
Executable file
Binary file not shown.
BIN
public/js/ckeditor/old/htmlwriter/assets/outputforflash/outputforflash.swf
Executable file
BIN
public/js/ckeditor/old/htmlwriter/assets/outputforflash/outputforflash.swf
Executable file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user