Файловый менеджер - Редактировать - /var/www/html/widgets.zip
Ðазад
PK ! ��� � Message.lessnu �[��� @import 'mediawiki.mixins'; .livechat-Message { display: flex; &.livechat-Message-reply { & > .avatar { margin-left: 2em; } } & > .avatar { flex: none; border-radius: 30px; width: 30px; height: 30px; margin-right: .7em; } & > .message { // flex: auto; position: relative; & > .reply-to { color: grey; } & > .body { padding: .5em; background-color: floralwhite; border-radius: 0 1em 1em 1em; & > .comment { .free { overflow-wrap: anywhere; } } & > .date { color: grey; padding-right: 4em; } } & > .reactions { position: absolute; right: 0; bottom: 23px; padding: 0 .4em; font-size: larger; cursor: pointer; .livechat-iconElement::before { padding: .2em; } } & > .footer { font-size: smaller; & > .oo-ui-buttonElement-frameless.oo-ui-widget-enabled > .oo-ui-buttonElement-button { color: darkgreen; &:hover { color: green; } } & > .oo-ui-buttonElement > .oo-ui-buttonElement-button { padding-top: 0.1em; font-weight: normal; } & > .oo-ui-buttonElement.clicked > .oo-ui-buttonElement-button { font-weight: bold; } } } &:not( :last-child ) { margin-bottom: .2em; } } PK ! ���Է � MessagesLayout.lessnu �[��� @padding: .5em; .oo-ui-MessagesLayout { & > .notification { position: relative; bottom: 22px; height: 0; margin: auto; & > span { padding: .5em; border-radius: .8em; color: lawngreen; background-color: #687F79; font-weight: bold; cursor: pointer; } } .livechat-MessageInput { padding-top: @padding; } .livechat-titleElement { padding-bottom: @padding; } } PK ! �z�7_ _ MessagesLayout.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function MessagesLayout( config ) { var $notificationPlaceholder; // Configuration initialization config = $.extend( { emptyLabelText: OO.ui.msg( 'ext-livechat-no-messages' ), replyButton: true, scrollDownOnDocumentReady: true, connectToServer: true }, config ); // Parent constructor MessagesLayout.parent.call( this, config ); // Initialization this.lastMessageId = 0; this.replyButton = config.replyButton; this.newMessages = 0; $notificationPlaceholder = $( '<div>' ) .addClass( 'notification' ) .insertAfter( this.$itemsElement ); this.$newMessageNotification = $( '<span>' ) .toggle( false ) .addClass( 'notification' ) .click( this.scrollDown.bind( this ) ) .appendTo( $notificationPlaceholder ); this.$itemsElement.scroll( this.onScrollItemsArea.bind( this ) ); this.messageInput = new mw.livechat.widgets.MessageInput(); this.$bottomElement.append( this.messageInput.$element ); this.$element.addClass( 'oo-ui-MessagesLayout' ); if ( config.scrollDownOnDocumentReady ) { $( function () { setTimeout( this.scrollDown, 1000 ); }.bind( this ) ); } // Events mw.livechat.events.connect( this, { LiveChatMessageConfirm: 'onLiveChatMessageConfirm', LiveChatMessage: 'onLiveChatMessage', LiveChatHistory: 'onLiveChatHistory', LiveChatReaction: 'onLiveChatReaction', // LiveChatReactionConfirm: 'onLiveChatReactionConfirm', close: 'onLiveChatClose' } ); this.aggregate( { replyClick: 'messageReplyClick' } ); if ( config.connectToServer ) { this.connectToServer(); } } mw.livechat.widgets.MessagesLayout = MessagesLayout; OO.inheritClass( MessagesLayout, mw.livechat.widgets.ItemsLayout ); MessagesLayout.prototype.connectToServer = function () { var data = {}; this.connected = true; if ( this.parentMessageId ) { data.parentId = this.parentMessageId; } mw.livechat.removeGroupItems( this ); mw.livechat.send( 'getLiveChatHistory', data ); this.messageInput.connectToServer(); }; MessagesLayout.prototype.disconnectFromServer = function () { this.connected = false; }; MessagesLayout.prototype.canScrollDownAutomatically = function() { return this.$itemsElement.scrollTop() >= this.$itemsElement.prop( "scrollHeight" ) - this.$itemsElement.innerHeight() - 77; }; MessagesLayout.prototype.scrollDown = OO.ui.debounce( function() { if ( this.$itemsElement ) { this.$itemsElement.scrollTop( this.$itemsElement.prop( "scrollHeight" ) - this.$itemsElement.innerHeight() + 1 ); this.newMessages = 0; this.$newMessageNotification.toggle( false ); } }, 200 ); MessagesLayout.prototype.informAboutNewMessage = function() { this.newMessages++; if ( this.newMessages === 1 ) { this.$newMessageNotification.toggle( true ); } this.$newMessageNotification.text( mw.msg( 'ext-livechat-new-comment-notification', this.newMessages ) ); }; MessagesLayout.prototype.onScrollItemsArea = OO.ui.debounce( function() { if ( this.newMessages && this.canScrollDownAutomatically() ) { this.newMessages = 0; this.$newMessageNotification.toggle( false ); } }, 50 ); MessagesLayout.prototype.onLiveChatMessage = function ( msg ) { var messageData = msg.messageData || {}, parentItem, parentMessageData; if ( !this.connected || ( this.parentMessageId && this.parentMessageId !== messageData.parentId && this.parentMessageId !== messageData.id ) ) { return; } if ( !this.parentMessageId && messageData.parentId ) { // update reply button text if not updated parentItem = this.findItemFromData( messageData.parentId ); if ( parentItem ) { parentMessageData = parentItem.getMessageData(); if ( !parentMessageData.hasChildren ) { parentMessageData.hasChildren = true; parentItem.updateReplyButtonText(); } } } var canScrollDown = this.canScrollDownAutomatically(), classes = this.parentMessageId && this.parentMessageId !== messageData.id ? [ 'livechat-Message-reply' ] : null, message = new mw.livechat.widgets.Message( { messageData: messageData, replyButton: this.replyButton, classes: classes } ); this.updateLastId( messageData.id ); if ( message.isValid() ) { this.addItems( [ message ] ); if ( canScrollDown ) { this.scrollDown(); } else { this.informAboutNewMessage(); } } }; MessagesLayout.prototype.onLiveChatHistory = function( historyData ) { if ( !this.connected || this.parentMessageId !== historyData.parentId ) { // Skip history of replies on main chat or history of another replies return ; } var messages = historyData.messages || []; $.each( messages, function ( i, messageData ) { this.onLiveChatMessage( { messageData: messageData } ); }.bind( this ) ); //this.updateLastId( historyData.id ); }; MessagesLayout.prototype.onLiveChatMessageConfirm = function( messageData ) { this.onLiveChatMessage( messageData ); }; MessagesLayout.prototype.onLiveChatClose = function() { this.loadHistoryFromLastMessage(); }; MessagesLayout.prototype.loadHistoryFromLastMessage = function () { var lastId = this.lastMessageId, data; if ( lastId && this.connected ) { data = { fromId: lastId }; if ( this.parentMessageId ) { data.parentId = this.parentMessageId; } mw.livechat.send( 'getLiveChatHistory', data ); } }; MessagesLayout.prototype.updateLastId = function( id ) { var intId = parseInt( id ); if ( intId && intId > this.lastMessageId ) { this.lastMessageId = id; } }; MessagesLayout.prototype.onLiveChatReactionConfirm = function ( messageData ) { var msg = this.onLiveChatReaction( messageData ); if ( msg ) { msg.setUserReaction( messageData.reaction ); } }; MessagesLayout.prototype.onLiveChatReaction = function ( messageData ) { var id = messageData.id, msg = this.findItemFromData( id ); if ( msg ) { msg.setReactions( messageData.messageReactions ); } return msg; }; MessagesLayout.prototype.setParentItemId = function( parentId ) { this.parentMessageId = parentId; this.messageInput.setParentId( parentId ); this.connectToServer(); }; } )( jQuery, mediaWiki, OO ); PK ! �q�z z IconWidget.jsnu �[��� /** * @author Pavel Astakhov <pastakhov@yandex.ru> */ ( function ( OO, $, mw ) { "use strict"; function IconWidget( config ) { // Configuration initialization config = config || {}; this.faIcon = config.faIcon; // Parent constructor IconWidget.parent.call( this, config ); // Mixin constructors mw.livechat.mixin.IconElement.call( this, $.extend( {}, config, { $icon: this.$element } ) ); } mw.livechat.widgets.IconWidget = IconWidget; OO.inheritClass( IconWidget, OO.ui.Widget ); OO.mixinClass( IconWidget, mw.livechat.mixin.IconElement ); IconWidget.static.tagName = 'i'; }( OO, jQuery, mediaWiki ) ); PK ! ��zc c ButtonWidget.jsnu �[��� /** * */ ( function ( OO, $, mw ) { "use strict"; mw.livechat.widgets.ButtonWidget = ButtonWidget; /* Setup */ OO.inheritClass( ButtonWidget, OO.ui.Widget ); OO.mixinClass( ButtonWidget, OO.ui.mixin.ButtonElement ); OO.mixinClass( ButtonWidget, mw.livechat.mixin.IconElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.IndicatorElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.LabelElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.TitledElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.FlaggedElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.TabIndexedElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.AccessKeyedElement ); OO.mixinClass( ButtonWidget, OO.ui.mixin.PendingElement ); function ButtonWidget ( config ) { // Configuration initialization config = config || {}; // Parent constructor ButtonWidget.parent.call( this, config ); // Mixin constructors OO.ui.mixin.ButtonElement.call( this, config ); mw.livechat.mixin.IconElement.call( this, config ); OO.ui.mixin.IndicatorElement.call( this, config ); OO.ui.mixin.LabelElement.call( this, config ); OO.ui.mixin.TitledElement.call( this, $.extend( {}, config, { $titled: this.$button } ) ); OO.ui.mixin.FlaggedElement.call( this, config ); OO.ui.mixin.TabIndexedElement.call( this, $.extend( {}, config, { $tabIndexed: this.$button } ) ); OO.ui.mixin.AccessKeyedElement.call( this, $.extend( {}, config, { $accessKeyed: this.$button } ) ); OO.ui.mixin.PendingElement.call( this, $.extend( {}, config, { $pending: this.$element } ) ); // Properties this.href = null; this.target = null; this.noFollow = false; // Events this.connect( this, { disable: 'onDisable' } ); // Initialization if ( config.iconAtTheEnd ) { this.$button.append( this.$indicator, this.$label, this.$icon ).addClass( 'iconAtTheEnd' ); } else { this.$button.append( this.$icon, this.$label, this.$indicator ); } this.$element .addClass( 'oo-ui-buttonWidget' ) .append( this.$button ); this.setActive( config.active ); this.setHref( config.href ); this.setTarget( config.target ); this.setNoFollow( config.noFollow ); } /* Static Properties */ /** * @static * @inheritdoc */ ButtonWidget.static.cancelButtonMouseDownEvents = false; /** * @static * @inheritdoc */ ButtonWidget.static.tagName = 'span'; /* Methods */ /** * Get hyperlink location. * * @return {string} Hyperlink location */ ButtonWidget.prototype.getHref = function () { return this.href; }; /** * Get hyperlink target. * * @return {string} Hyperlink target */ ButtonWidget.prototype.getTarget = function () { return this.target; }; /** * Get search engine traversal hint. * * @return {boolean} Whether search engines should avoid traversing this hyperlink */ ButtonWidget.prototype.getNoFollow = function () { return this.noFollow; }; /** * Set hyperlink location. * * @param {string|null} href Hyperlink location, null to remove */ ButtonWidget.prototype.setHref = function ( href ) { href = typeof href === 'string' ? href : null; if ( href !== null && !OO.ui.isSafeUrl( href ) ) { href = './' + href; } if ( href !== this.href ) { this.href = href; this.updateHref(); } return this; }; /** * Update the `href` attribute, in case of changes to href or * disabled state. * * @private * @chainable */ ButtonWidget.prototype.updateHref = function () { if ( this.href !== null && !this.isDisabled() ) { this.$button.attr( 'href', this.href ); } else { this.$button.removeAttr( 'href' ); } return this; }; /** * Handle disable events. * * @private */ ButtonWidget.prototype.onDisable = function () { this.updateHref(); }; /** * Set hyperlink target. * * @param {string|null} target Hyperlink target, null to remove */ ButtonWidget.prototype.setTarget = function ( target ) { target = typeof target === 'string' ? target : null; if ( target !== this.target ) { this.target = target; if ( target !== null ) { this.$button.attr( 'target', target ); } else { this.$button.removeAttr( 'target' ); } } return this; }; /** * Set search engine traversal hint. * * @param {boolean} noFollow True if search engines should avoid traversing this hyperlink */ ButtonWidget.prototype.setNoFollow = function ( noFollow ) { noFollow = typeof noFollow === 'boolean' ? noFollow : true; if ( noFollow !== this.noFollow ) { this.noFollow = noFollow; if ( noFollow ) { this.$button.attr( 'rel', 'nofollow' ); } else { this.$button.removeAttr( 'rel' ); } } return this; }; }( OO, jQuery, mediaWiki ) ); PK ! � � � LiveChatLayout.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function LiveChatLayout( config ) { // Parent constructor LiveChatLayout.parent.call( this, { padded: false, framed: false } ); var messagesTitle = new OO.ui.LabelWidget( { label: 'Comments', classes: [ 'livechat-titleElement' ] } ), replyGoBackButton = new OO.ui.ButtonWidget( { icon: 'previous', framed: false } ), replyUserLabel = new OO.ui.LabelWidget(), replyTitle = new OO.ui.HorizontalLayout( { items: [ replyGoBackButton, replyUserLabel ], classes: [ 'livechat-titleElement' ] }); this.replyUserLabel = replyUserLabel; this.messages = new mw.livechat.widgets.MessagesLayout( config ); this.messages.$topElement.append( messagesTitle.$element ); this.replyMessages = new mw.livechat.widgets.MessagesLayout( $.extend( config, { connectToServer: false, replyButton: false } ) ); this.replyMessages.toggle( false ); this.replyMessages.$topElement.append( replyTitle.$element ); this.$element.append( this.messages.$element, this.replyMessages.$element ); // Events this.messages.connect( this, { messageReplyClick: 'onMessageReplyClick' } ); replyGoBackButton.connect( this, { click: 'onReplyGoBackClick' } ); } mw.livechat.widgets.LiveChatLayout = LiveChatLayout; OO.inheritClass( LiveChatLayout, OO.ui.PanelLayout ); LiveChatLayout.prototype.connectToServer = function () { this.messages.connectToServer(); }; LiveChatLayout.prototype.onMessageReplyClick = function ( item ) { var itemMessageData = item.getMessageData(), itemId = itemMessageData.parentId || itemMessageData.id, userName = itemMessageData.parentUserName || itemMessageData.userName, labelText = 'Reply to: ' + userName; this.replyUserLabel.setLabel( labelText ); this.messages.toggle( false ); this.replyMessages.toggle( true ); this.replyMessages.setParentItemId( itemId ); }; LiveChatLayout.prototype.onReplyGoBackClick = function () { this.replyMessages.toggle( false ); this.messages.toggle( true ); }; } )( jQuery, mediaWiki, OO ); PK ! b�?C� � SplitLayout.lessnu �[��� @import 'mediawiki.mixins'; .livechat-splitLayout { display: flex; > * { /* display: table-cell; vertical-align: top;*/ border-left: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa; width: 50%; } > .ui-resizable { flex: none; } > :first-child { border-left: none; } > :last-child { border-right: none; } .ui-resizable-handle { cursor: col-resize; } } PK ! ��,� � MessageInput.lessnu �[��� .livechat-MessageInput { .livechat-MessageInput-message, & > .oo-ui-actionFieldLayout.oo-ui-fieldLayout-align-top { max-width: none; } } PK ! z]c c ItemsLayout.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function ItemsLayout( config ) { // Configuration initialization config = $.extend( { expanded: false, framed: true, padded: true, emptyLabel: true }, config ); // Parent constructor ItemsLayout.parent.call( this, config ); // Mixin constructors this.$itemsElement = config.$itemsElement || $( '<div class="widget-livechat-items-layout">' ); OO.ui.mixin.PendingElement.call( this, $.extend( { $pending: this.$element }, config ) ); OO.ui.mixin.GroupElement.call( this, $.extend( {}, config, { $group: this.$itemsElement } ) ); // Initialization this.$topElement = config.$topElement || $( '<div class="widget-livechat-top-element">'); this.$bottomElement = config.$bottomElement || $( '<div class="widget-livechat-bottom-element">'); this.$element.append( this.$topElement, this.$itemsElement, this.$bottomElement ); this.emptyLabelText = config.emptyLabelText; if ( config.emptyLabel ) { this.$itemsElement.append( $( '<div class="widget-livechat-list-empty">' ).append( new OO.ui.ButtonWidget( { label: this.emptyLabelText || 'Empty list', framed: false, icon: 'info', disabled: true } ).$element ) ); } if ( config.items ) { this.addItems( config.items ); } } mw.livechat.widgets.ItemsLayout = ItemsLayout; OO.inheritClass( ItemsLayout, OO.ui.PanelLayout ); OO.mixinClass( ItemsLayout, OO.ui.mixin.PendingElement ); OO.mixinClass( ItemsLayout, OO.ui.mixin.GroupElement ); ItemsLayout.prototype.addItems = function( items ) { $.each( items, function( index, obj ) { obj.$element.toggleClass( 'widget-livechat-item', true ); } ); return OO.ui.mixin.GroupElement.prototype.addItems.apply( this, arguments ); }; ItemsLayout.prototype.destroyItems = function () { mw.marefa.removeGroupItems( this ); }; }( jQuery, mediaWiki, OO ) ); PK ! ,��H H SplitLayout.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; mw.livechat.widgets.SplitLayout = SplitLayout; OO.inheritClass( SplitLayout, OO.ui.PanelLayout ); function SplitLayout( config ) { // Configuration initialization config = $.extend( { expanded: false, framed: true, padded: false, minColumnWidth: 200 }, config ); // Parent constructor SplitLayout.parent.call( this, config ); // Properties this.minColumnWidth = config.minColumnWidth; // Initialization this.$splitElement = config.$splitElement || $( '<div class="livechat-split-layout">' ); this.$topElement = config.$topElement || $( '<div class="livechat-split-top">'); this.$bottomElement = config.$bottomElement || $( '<div class="livechat-split-bottom">'); this.$splitElement.append( this.$element.children() ); this.$element.append( this.$topElement, this.$splitElement, this.$bottomElement ); this.split(); } SplitLayout.prototype.setContent = function ( content ) { this.$splitElement.empty().append( content.map( function ( v ) { if ( typeof v === 'string' ) { // Escape string so it is properly represented in HTML. return document.createTextNode( v ); } else if ( v instanceof OO.ui.HtmlSnippet ) { // Bypass escaping. return v.toString(); } else if ( v instanceof OO.ui.Element ) { return v.$element; } return v; } ) ); this.split(); }; SplitLayout.prototype.split = function () { var widget = this, children = this.$splitElement.children(); this.$splitElement.toggleClass( 'livechat-splitLayout', true ); $.each( children, function ( index, $element ) { var wrapper = $( '<div>' ).append( $element ); widget.$splitElement.append( wrapper ); } ); this.$splitElement.children( ':first' ).resizable( { handles: 'e', minWidth: this.minColumnWidth, resize: this.onSplitResize.bind( this ) } ); }; SplitLayout.prototype.onSplitResize = function ( event, ui ) { var $nextElement = ui.element.next(), nextElemWidth = this.$splitElement.width() - ui.element.width(), minColumnWidth = this.minColumnWidth; if ( nextElemWidth < minColumnWidth ) { ui.element.width( this.$splitElement.width() - minColumnWidth ); $nextElement.width( minColumnWidth ); } else { $nextElement.width( nextElemWidth ); } ui.element.height( '' ); }; }( jQuery, mediaWiki, OO ) ); PK ! LiveChatLayout.lessnu �[��� PK ! up � � ItemsLayout.lessnu �[��� .widget-livechat-list-empty { display: none; } .widget-livechat-items-layout > .widget-livechat-list-empty:last-child { display: block; } PK ! �bх� � mixin/IconElement.jsnu �[��� /** * @author Pavel Astakhov <pastakhov@yandex.ru> */ ( function ( OO, $, mw ) { "use strict"; function IconElement( config ) { // Configuration initialization config = $.extend( { faClass: 'far', }, config ); // Properties this.$icon = null; this.icon = null; this.iconTitle = null; this.iconType = null; this.iconFixedWidth = !!config.iconFixedWidth; this.faClass = config.faClass; // Initialization this.setIcon( config.icon || this.constructor.static.icon ); this.setIconTitle( config.iconTitle || this.constructor.static.iconTitle ); this.setIconElement( config.$icon || $( '<i>' ) ); } mw.livechat.mixin.IconElement = IconElement; /* Setup */ OO.initClass( mw.livechat.mixin.IconElement ); IconElement.static.icon = null; IconElement.static.iconTitle = null; IconElement.prototype.setIconElement = function ( $icon ) { if ( this.$icon ) { this.$icon .removeClass( 'livechat-iconElement-icon livechat-icon-' + this.icon ) .removeAttr( 'title' ); } this.$icon = $icon.addClass( 'livechat-iconElement-icon' ); if ( this.iconType === 'FA' ) { $icon.toggleClass( this.faClass, !!this.icon ); $icon.toggleClass( 'fa-' + this.icon, !!this.icon ); $icon.toggleClass( 'fa-fw', this.iconFixedWidth ); } else { $icon.toggleClass( 'livechat-icon-' + this.icon, !!this.icon ); } this.updateThemeClasses(); }; IconElement.prototype.setFAClass = function ( faClass ) { if ( this.faClass !== faClass ) { if ( this.faClass ) { this.$icon.removeClass( this.faClass ); } if ( faClass ) { this.$icon.addClass( faClass ); } this.faClass = faClass; } }; IconElement.prototype.setIcon = function ( icon ) { var iconType; icon = OO.isPlainObject( icon ) ? OO.ui.getLocalValue( icon, null, 'default' ) : icon; icon = typeof icon === 'string' && icon.trim().length ? icon.trim() : null; if ( icon && icon.substr( 0, 3 ) === 'fa-' ) { icon = icon.substr( 3 ); iconType = 'FA'; } if ( this.icon !== icon ) { if ( this.$icon ) { if ( this.icon !== null ) { if ( this.iconType === 'FA' ) { this.$icon.removeClass( this.faClass ); this.$icon.removeClass( 'fa-' + this.icon ); this.$icon.removeClass( 'fa-fw' ); } else { this.$icon.removeClass( 'livechat-icon-' + this.icon ); } } if ( icon !== null ) { if ( iconType === 'FA' ) { this.$icon.addClass( this.faClass ); this.$icon.addClass( 'fa-' + icon ); this.$icon.toggleClass( 'fa-fw', this.iconFixedWidth ); } else { this.$icon.addClass( 'livechat-icon-' + icon ); } } } this.icon = icon; this.iconType = iconType; } this.$element.toggleClass( 'livechat-iconElement', !!this.icon ); this.updateThemeClasses(); return this; }; IconElement.prototype.setIconTitle = function ( iconTitle ) { iconTitle = typeof iconTitle === 'function' || ( typeof iconTitle === 'string' && iconTitle.length ) ? OO.ui.resolveMsg( iconTitle ) : null; if ( this.iconTitle !== iconTitle ) { this.iconTitle = iconTitle; if ( this.$icon ) { if ( this.iconTitle !== null ) { this.$icon.attr( 'title', iconTitle ); } else { this.$icon.removeAttr( 'title' ); } } } return this; }; }( OO, jQuery, mediaWiki ) ); PK ! G�. . widgets.jsnu �[��� /** * */ ( function ( mw, OO, $ ) { "use strict"; mw.livechat = mw.livechat || {}; mw.livechat.widgets = mw.livechat.widgets || {}; mw.livechat.mixin = mw.livechat.mixin || {}; mw.livechat.onApiError = function( code, data ) { var error; if ( data && data.exception ) { error = data.exception; } else { error = 'Error: ' + code; if ( data && data.error && data.error.info ) { error = error + ', ' + data.error.info; } } mw.log( arguments ); mw.log.error( error ); mw.notify( error, { title: 'Error', type: 'error' } ); return error; }; function pad( n ) { return n < 10 ? '0' + n : n; } /** * Returns timestamp string like '20190106005141' from Date object * @param {Date} date * @returns {string} */ mw.livechat.getTimeStamp = function( date ) { return date.getFullYear() + pad( date.getMonth() + 1 ) + pad( date.getDate() ) + pad( date.getHours() ) + pad( date.getMinutes() ) + pad( date.getSeconds() ); }; /** * It returns the number of milliseconds since January 1, 1970, 00:00:00 UTC * from timestamp string like '20190106005141' * @param {string} timestamp * @returns number */ mw.livechat.parseTimeStamp = function( timestamp ) { if ( !timestamp ) { mw.log.warn( 'timestamp is null' ); return Date.now(); } return Date.UTC( parseInt( timestamp.substr( 0, 4 ) ), // YYYY parseInt( timestamp.substr( 4, 2 ) ) - 1, // MM parseInt( timestamp.substr( 6, 2 ) ), // DD parseInt( timestamp.substr( 8, 2 ) ), // hh parseInt( timestamp.substr( 10, 2 ) ), // mm parseInt( timestamp.substr( 12, 2 ) )// ss ); }; mw.livechat.timeDifferenceShort = function( previous, current ) { var msPerMinute = 60 * 1000, msPerHour = msPerMinute * 60, msPerDay = msPerHour * 24, msPerWeek = msPerDay * 7, msPerMonth = msPerDay * 30, msPerYear = msPerDay * 365, difference = (current || Date.now()) - previous, elapsed = Math.abs( difference ), text; if ( elapsed < msPerMinute ) { text = '< 1 minute'; } else if ( elapsed < msPerHour ) { text = Math.round( elapsed / msPerMinute ) + ' minute(s)'; } else if ( elapsed < msPerDay ) { text = Math.round( elapsed / msPerHour ) + ' hour(s)'; } else if ( elapsed < msPerMonth ) { text = Math.round( elapsed / msPerDay ) + ' day(s)'; } else if ( elapsed < msPerYear ) { text= Math.round( elapsed / msPerWeek ) + ' week(s)'; } else { text = Math.round( elapsed / msPerYear ) + ' year(s)'; } if ( difference > 0 ) { return text + ' ago'; } return 'in ' + text; }; mw.livechat.removeGroupItems = function ( uiGroupElement ) { var oldItems = uiGroupElement.getItems(); if ( oldItems.length > 0 ) { uiGroupElement.clearItems(); $.each( oldItems, function( key, item ) { item.$element.remove(); } ); } }; }( mediaWiki, OO, jQuery ) ); PK ! K��q� � RoomListLayout.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function RoomListLayout( config ) { config = $.extend( { connectToServer: true }, config ); // Parent constructor RoomListLayout.parent.call( this, config ); this.online = mw.livechat.getReadyState() === WebSocket.OPEN; // Events mw.livechat.events.connect( this, { reconnect: 'onConnectionReconnected', close: 'onConnectionClose', LiveChatManagerListRooms: 'onLiveChatManagerListRooms' } ); if ( config.connectToServer ) { this.connectToServer(); } } mw.livechat.widgets.RoomListLayout = RoomListLayout; OO.inheritClass( RoomListLayout, mw.livechat.widgets.ItemsLayout ); RoomListLayout.prototype.connectToServer = function () { this.connected = true; mw.livechat.send( 'getRoomList' ); this.online = true; }; RoomListLayout.prototype.onConnectionClose = function () { this.online = false; }; RoomListLayout.prototype.onConnectionReconnected = function () { if ( this.connected ) { this.connectToServer(); } }; RoomListLayout.prototype.onLiveChatManagerListRooms = function ( response ) { var answer = response && response.answer || {}, id, items = []; mw.livechat.removeGroupItems( this ); for ( id in answer ) { if ( answer.hasOwnProperty( id ) ) { items.push( new OO.ui.LabelWidget( { label: answer[id], data: id } ) ); } } if ( items.length ) { this.addItems( items ); } }; } )( jQuery, mediaWiki, OO ); PK ! lp��N N Message.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function Message( config ) { config = $.extend( { replyButton: true }, config ); var messageData = config.messageData || {}, $message = $( '<div>' ), $messageBottom = $( '<div>' ), $messageElement = $( '<div>' ), // reactionButton = new mw.livechat.widgets.ButtonWidget( { label: 'reaction', icon: 'fa-heart', framed: false, iconAtTheEnd: true } ), replyToText = config.replyButton && messageData.parentUserName && 'Reply to: ' + messageData.parentUserName; // Parent constructor Message.parent.call( this, config ); this.messageData = messageData; if ( config.replyButton ) { this.replyButton = new mw.livechat.widgets.ButtonWidget( { icon: 'fa-reply', faClass: 'fas', framed: false, iconAtTheEnd: true } ); this.updateReplyButtonText(); } if ( replyToText ) { $message.append( $( '<div>' ).text( replyToText ).addClass( 'reply-to' ) ); } if ( messageData.userAvatar ) { $( '<img>' ) .attr( { src: messageData.userAvatar } ) .addClass( 'avatar' ) .appendTo( this.$element ); } else { // if ( Math.floor(Math.random() * 2 ) ) { // $( '<img>' ) // .attr( { src: 'https://www.marefa.org/images/avatars/wikidb_52688_m.jpg?r=1567774792' } ) // .addClass( 'avatar' ) // .appendTo( this.$element ); // } else { new OO.ui.IconWidget( { icon: 'userAvatar', classes: ['avatar'] } ).$element.appendTo( this.$element ); // } } this.setData( messageData.id ); this.$reactions = $( '<div>' ).addClass( 'reactions' ); if ( messageData.reactions ) { this.setReactions( messageData.reactions ); } this.timestamp = new Date( mw.livechat.parseTimeStamp( messageData.timestamp ) ); this.$date = $( '<div>' ).addClass( 'date' ); this.$comment = $( '<div>' ).addClass( 'comment' ); this.setComment( messageData.message ); $messageElement .addClass( 'body' ) .append( this.$comment, this.$date ); this.likeButton = new mw.livechat.widgets.ButtonWidget( { label: mw.msg( 'ext-livechat-reaction-like' ), icon: 'fa-thumbs-up', framed: false, iconAtTheEnd: true } ); this.setUserReaction( messageData.userReaction ); $messageBottom.append( this.likeButton.$element/*, reactionButton.$element,*/ ); if ( this.replyButton ) { $messageBottom.append( this.replyButton.$element ); } $messageBottom.addClass( 'footer' ); $message .append( $( '<div>' ).text( messageData.userName ) ) .append( $messageElement, $messageBottom, this.$reactions ) .addClass( 'message' ); this.$element .addClass( 'livechat-Message' ) .append( $message ); this.isValidState = messageData.userName && messageData.message; // Events this.likeButton.connect( this, { click: 'onLikeButtonClick' } ); if ( this.replyButton ) { this.replyButton.connect( this, { click: 'onReplyButtonClick' } ); } this.updateTimeText(); } mw.livechat.widgets.Message = Message; OO.inheritClass( Message, OO.ui.Widget ); Message.prototype.setComment = function ( message ) { if ( !Array.isArray( message ) ) { this.$comment.text( message ); return; } var html = $.map( message, function ( value ) { switch ( value.type ) { case 'externalLink': return $( '<a>' ) .text( value.text ) .attr( { href: value.url, target: '_blank', rel: 'nofollow' } ) .addClass( 'external link-https ' + (value.free ? 'free' : 'text') )[0].outerHTML; case 'internalLink': return $( '<a>' ) .text( value.text ) .attr( { href: value.url, target: '_blank' } )[0].outerHTML; case 'text': default: return $( '<span>' ).text( value.text || ' *undefined* ' )[0].outerHTML; } } ).join( '' ); this.$comment.html( html ); }; Message.prototype.isValid = function () { return !!this.isValidState; }; Message.prototype.onLikeButtonClick = function () { mw.livechat.send( 'LiveChatReaction', { reaction: 'like', message: this.getData() } ); }; Message.prototype.onReplyButtonClick = function () { this.emit( 'replyClick' ); }; Message.prototype.setReactions = function ( reactions ) { this.$reactions.empty(); if ( reactions.like ) { this.$reactions.append( new mw.livechat.widgets.IconWidget( { icon: 'fa-thumbs-up', faClass: 'fas', text: reactions.like } ).$element ); } }; Message.prototype.setUserReaction = function ( reaction ) { var icon = 'fa-thumbs-up', faClass = reaction ? 'fas' : 'far'; this.likeButton.setIcon( icon ); this.likeButton.setFAClass( faClass ); this.likeButton.$element.toggleClass( 'clicked', !!reaction ); }; Message.prototype.updateTimeText = function () { var timestamp = this.timestamp, dateString = ( '0' + timestamp.getHours() ).slice( -2 ) + ':' + ( '0' + timestamp.getMinutes() ).slice( -2 ); if ( timestamp.toDateString() !== new Date( Date.now() ).toDateString() ) { dateString = timestamp.getDate() + ' ' + mw.config.get( 'wgMonthNamesShort' )[timestamp.getMonth() + 1] + ' ' + dateString; } this.$date.text( dateString ); }; Message.prototype.getMessageData = function () { return this.messageData; }; Message.prototype.updateReplyButtonText = function () { if ( !this.replyButton ) { return; } var messageData = this.messageData, text = ( messageData.parentId || messageData.hasChildren ) ? 'discussion' : 'reply'; this.replyButton.setLabel( text ); }; } )( jQuery, mediaWiki, OO ); PK ! lJ� ButtonWidget.lessnu �[��� .oo-ui-buttonWidget { & > .oo-ui-buttonElement-button.iconAtTheEnd { & > .livechat-iconElement-icon { margin-left: .2em; } } & > .oo-ui-buttonElement-button:not( .iconAtTheEnd ) { & > .livechat-iconElement-icon { margin-right: .2em; } } } PK ! /�W¦ � MessageInput.jsnu �[��� /** * */ ( function ( $, mw, OO ) { "use strict"; function MessageInput( config ) { config = config || {}; // Construct buttons before parent method is called (calling setDisabled) this.sendButton = new OO.ui.ButtonWidget( $.extend( { $element: $( '<label>' ), classes: [ 'livechat-MessageInput-sendButton' ], label: OO.ui.msg( 'ext-livechat-messageinput-button-send' ) }, config.button ) ); // Configuration initialization config = $.extend( { placeholder: OO.ui.msg( 'ext-livechat-messageinput-placeholder' ) }, config ); this.messageInput = new OO.ui.TextInputWidget( { classes: [ 'livechat-MessageInput-message' ], placeholder: config.placeholder } ); // Parent constructor MessageInput.parent.call( this, config ); // Mixin constructors OO.ui.mixin.PendingElement.call( this, $.extend( {}, config, { $pending: this.$element } ) ); this.fieldLayout = new OO.ui.ActionFieldLayout( this.messageInput, this.sendButton, { align: 'top' } ); //this.sendButton.$button.append( this.$input ); this.$element .addClass( 'livechat-MessageInput' ) .append( this.fieldLayout.$element ); // Events this.sendButton.connect( this, { click: 'onSendClick' } ); this.messageInput.connect( this, { enter: 'onSendClick' } ); mw.livechat.events.connect( this, { LiveChatMessageConfirm: 'onMessageConfirm', permissions: 'onPermissions', } ); } mw.livechat.widgets.MessageInput = MessageInput; OO.inheritClass( MessageInput, OO.ui.Widget ); OO.mixinClass( MessageInput, OO.ui.mixin.PendingElement ); MessageInput.prototype.connectToServer = function() { mw.livechat.send( 'getPermissions', { list: [ 'canPost' ] } ); }; MessageInput.prototype.onSendClick = function () { var message = this.messageInput.getValue(), data = { message: message }; if ( this.parentId ) { data.parentId = this.parentId; } this.pushPending(); this.messageInput.setDisabled( true ); this.sendButton.setDisabled( true ); this.time = mw.livechat.send( 'LiveChatMessage', data ); }; MessageInput.prototype.onMessageConfirm = function( messageData ) { if ( ( !messageData.clientTime || messageData.clientTime === this.time ) && ( !this.parentId || this.parentId === messageData.parentId ) ) { this.messageInput.setValue(''); this.messageInput.setDisabled( false ); this.sendButton.setDisabled( false ); this.popPending(); } if ( messageData.error ) { mw.notify( messageData.error, { type: 'error' } ); } }; MessageInput.prototype.onPermissions = function( info ) { var permissions = info && info.permissions || {}, $loginLink, loginText; if ( permissions.canPost === false ) { this.messageInput.setDisabled( true ); this.sendButton.setDisabled( true ); if ( mw.config.get( 'wgUserName' ) === null ) { loginText = OO.ui.msg( 'ext-livechat-login-to-post-comments' ); $loginLink = $( '<a>' ) .text( loginText ) .attr( { href: mw.util.getUrl( 'Special:UserLogin' ) } ); this.$element.prepend( $loginLink ); this.messageInput.setTitle( loginText ); this.sendButton.setTitle( loginText ); } } }; MessageInput.prototype.setParentId = function( parentId ) { if ( this.parentId !== parentId ) { this.messageInput.setValue(''); this.messageInput.setDisabled( false ); this.sendButton.setDisabled( false ); if ( this.isPending() ) { this.popPending(); } this.parentId = parentId; } }; }( jQuery, mediaWiki, OO ) ); PK ! ��� � Message.lessnu �[��� PK ! ���Է � � MessagesLayout.lessnu �[��� PK ! �z�7_ _ � MessagesLayout.jsnu �[��� PK ! �q�z z ^ IconWidget.jsnu �[��� PK ! ��zc c # ButtonWidget.jsnu �[��� PK ! � � � �5 LiveChatLayout.jsnu �[��� PK ! b�?C� � �= SplitLayout.lessnu �[��� PK ! ��,� � �? MessageInput.lessnu �[��� PK ! z]c c �@ ItemsLayout.jsnu �[��� PK ! ,��H H .H SplitLayout.jsnu �[��� PK ! �Q LiveChatLayout.lessnu �[��� PK ! up � � �Q ItemsLayout.lessnu �[��� PK ! �bх� � �R mixin/IconElement.jsnu �[��� PK ! G�. . �_ widgets.jsnu �[��� PK ! K��q� � fk RoomListLayout.jsnu �[��� PK ! lp��N N _q Message.jsnu �[��� PK ! lJ� � ButtonWidget.lessnu �[��� PK ! /�W¦ � ;� MessageInput.jsnu �[��� PK � �
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка