This commit is contained in:
2026-03-20 17:13:38 +01:00
parent 4c84735b75
commit c043ee9a52
1152 changed files with 317560 additions and 0 deletions
@@ -0,0 +1,122 @@
/* ===========================================================
* trumbowyg.mention.js v0.1
* Mention plugin for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author : Viper
* Github: https://github.com/Globulopolis
* Website: http://киноархив.com
*/
(function ($) {
'use strict';
var defaultOptions = {
source: [],
formatDropdownItem: formatDropdownItem,
formatResult: formatResult
};
$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
en: {
mention: 'Mention'
},
da: {
mention: 'Nævn'
},
et: {
mention: 'Maini'
},
fr: {
mention: 'Mentionner'
},
hu: {
mention: 'Említ'
},
ko: {
mention: '언급'
},
pt_br: {
mention: 'Menção'
},
ru: {
mention: 'Упомянуть'
},
tr: {
mention: 'Bahset'
},
zh_tw: {
mention: '標記'
},
// jshint camelcase:true
},
plugins: {
mention: {
init: function (trumbowyg) {
trumbowyg.o.plugins.mention = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.mention || {});
var btnDef = {
dropdown: buildDropdown(trumbowyg.o.plugins.mention.source, trumbowyg)
};
trumbowyg.addBtnDef('mention', btnDef);
}
}
}
});
/**
* Build dropdown list
*
* @param {Array} items Items
* @param {object} trumbowyg Editor
*
* @return {Array}
*/
function buildDropdown(items, trumbowyg) {
var dropdown = [];
$.each(items, function (i, item) {
var btn = 'mention-' + i,
btnDef = {
hasIcon: false,
text: trumbowyg.o.plugins.mention.formatDropdownItem(item),
fn: function () {
trumbowyg.execCmd('insertHTML', trumbowyg.o.plugins.mention.formatResult(item));
return true;
}
};
trumbowyg.addBtnDef(btn, btnDef);
dropdown.push(btn);
});
return dropdown;
}
/**
* Format item in dropdown.
*
* @param {object} item Item object.
*
* @return {string}
*/
function formatDropdownItem(item) {
return item.login;
}
/**
* Format result pasted in editor.
*
* @param {object} item Item object.
*
* @return {string}
*/
function formatResult(item) {
return '@' + item.login + ' ';
}
})(jQuery);
@@ -0,0 +1 @@
!function(n){"use strict";var t={source:[],formatDropdownItem:function(n){return n.login},formatResult:function(n){return"@"+n.login+" "}};function o(t,o){var e=[];return n.each(t,(function(n,t){var i="mention-"+n,r={hasIcon:!1,text:o.o.plugins.mention.formatDropdownItem(t),fn:function(){return o.execCmd("insertHTML",o.o.plugins.mention.formatResult(t)),!0}};o.addBtnDef(i,r),e.push(i)})),e}n.extend(!0,n.trumbowyg,{langs:{en:{mention:"Mention"},da:{mention:"Nævn"},et:{mention:"Maini"},fr:{mention:"Mentionner"},hu:{mention:"Említ"},ko:{mention:"언급"},pt_br:{mention:"Menção"},ru:{mention:"Упомянуть"},tr:{mention:"Bahset"},zh_tw:{mention:"標記"}},plugins:{mention:{init:function(e){e.o.plugins.mention=n.extend(!0,{},t,e.o.plugins.mention||{});var i={dropdown:o(e.o.plugins.mention.source,e)};e.addBtnDef("mention",i)}}}})}(jQuery);
@@ -0,0 +1,29 @@
/**
* Trumbowyg v2.25.1 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
* @license MIT
* @author Alexandre Demode (Alex-D)
* Twitter : @AlexandreDemode
* Website : alex-d.fr
*/
.trumbowyg-dropdown-mention {
button {
position: relative;
white-space: nowrap;
&:after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 15%;
height: 100%;
background-size: 100%;
background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
pointer-events: none;
}
}
}
@@ -0,0 +1,28 @@
/**
* Trumbowyg v2.25.1 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
* @license MIT
* @author Alexandre Demode (Alex-D)
* Twitter : @AlexandreDemode
* Website : alex-d.fr
*/
.trumbowyg-dropdown-mention button {
position: relative;
white-space: nowrap; }
.trumbowyg-dropdown-mention button:after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 15%;
height: 100%;
-webkit-background-size: 100% 100%;
background-size: 100%;
background-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), color-stop(80%, #ffffff), to(#ffffff));
background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
pointer-events: none; }
@@ -0,0 +1,2 @@
/** Trumbowyg v2.25.1 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
.trumbowyg-dropdown-mention button{position:relative;white-space:nowrap}.trumbowyg-dropdown-mention button:after{content:"";position:absolute;top:0;right:0;width:15%;height:100%;-webkit-background-size:100% 100%;background-size:100%;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),color-stop(80%,#fff),to(#fff));background-image:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);background-image:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 80%,#fff 100%);pointer-events:none}