mirror of
https://github.com/humhub/humhub.git
synced 2025-01-29 04:17:39 +01:00
Asset Rebuild
This commit is contained in:
parent
a18d0c2515
commit
25b30efe94
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* This file is generated by the "yii asset" command.
|
||||
* DO NOT MODIFY THIS FILE DIRECTLY.
|
||||
* @version 2017-03-17 13:04:33
|
||||
* @version 2017-03-28 18:59:27
|
||||
*/
|
||||
return [
|
||||
'all' => [
|
||||
@ -10,10 +10,10 @@ return [
|
||||
'basePath' => '@webroot-static',
|
||||
'baseUrl' => '@web-static',
|
||||
'js' => [
|
||||
'js/all-05277b1a16b58bb28938b1561d10a390.js',
|
||||
'js/all-b70cdb39f0863912ffe5ff2a35826714.js',
|
||||
],
|
||||
'css' => [
|
||||
'css/all-5c2de45f6bcfd0a59e11e82f44411f5f.css',
|
||||
'css/all-f3df348618e1b371f6a5c7414de1ac08.css',
|
||||
],
|
||||
'sourcePath' => null,
|
||||
'depends' => [],
|
||||
|
@ -1,4 +1,4 @@
|
||||
humhub.module('comment', function(module, require, $) {
|
||||
humhub.module('comment', function (module, require, $) {
|
||||
var Content = require('content').Content;
|
||||
var Widget = require('ui.widget').Widget;
|
||||
var object = require('util').object;
|
||||
@ -6,122 +6,138 @@ humhub.module('comment', function(module, require, $) {
|
||||
var loader = require('ui.loader');
|
||||
var additions = require('ui.additions');
|
||||
|
||||
var Form = function(node, options) {
|
||||
var Form = function (node, options) {
|
||||
Widget.call(this, node, options);
|
||||
};
|
||||
|
||||
object.inherits(Form, Widget);
|
||||
|
||||
Form.prototype.submit = function(evt) {
|
||||
Form.prototype.submit = function (evt) {
|
||||
var that = this;
|
||||
client.submit(evt, {dataType: 'html'}).then(function(response) {
|
||||
client.submit(evt, {dataType: 'html'}).then(function (response) {
|
||||
that.addComment(response.html);
|
||||
that.getInput().val('').trigger('autosize.resize');
|
||||
that.getRichtext().$.addClass('atwho-placeholder').focus();
|
||||
that.getUpload().reset();
|
||||
}).catch(function(err) {
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
});
|
||||
};
|
||||
|
||||
Form.prototype.getRichtext = function() {
|
||||
|
||||
Form.prototype.getRichtext = function () {
|
||||
return Widget.instance(this.$.find('div.humhub-ui-richtext'));
|
||||
};
|
||||
|
||||
Form.prototype.addComment = function(html) {
|
||||
|
||||
Form.prototype.addComment = function (html) {
|
||||
var $html = $(html).hide();
|
||||
additions.applyTo($html);
|
||||
this.getCommentsContainer().append($html);
|
||||
this.incrementCommentCount(1);
|
||||
$html.fadeIn();
|
||||
};
|
||||
|
||||
Form.prototype.getUpload = function(html) {
|
||||
Form.prototype.incrementCommentCount = function (count) {
|
||||
try {
|
||||
var $controls = this.$.closest('.comment-container').siblings('.wall-entry-controls');
|
||||
var $commentCount = $controls.find('.comment-count');
|
||||
if($commentCount.length) {
|
||||
var currentCount = $commentCount.data('count');
|
||||
currentCount += count;
|
||||
$commentCount.text(' ('+currentCount+')').show();
|
||||
$commentCount.data('count', currentCount);
|
||||
}
|
||||
} catch(e) {
|
||||
module.log.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
Form.prototype.getUpload = function () {
|
||||
return Widget.instance(this.$.find('[name="files[]"]'));
|
||||
};
|
||||
|
||||
Form.prototype.getCommentsContainer = function(html) {
|
||||
|
||||
Form.prototype.getCommentsContainer = function () {
|
||||
return this.$.siblings('.comment');
|
||||
};
|
||||
|
||||
Form.prototype.getInput = function() {
|
||||
|
||||
Form.prototype.getInput = function () {
|
||||
return this.$.find('textarea');
|
||||
};
|
||||
|
||||
var Comment = function(node) {
|
||||
var Comment = function (node) {
|
||||
Content.call(this, node);
|
||||
additions.observe(this.$);
|
||||
};
|
||||
|
||||
object.inherits(Comment, Content);
|
||||
|
||||
Comment.prototype.edit = function(evt) {
|
||||
Comment.prototype.edit = function (evt) {
|
||||
this.loader();
|
||||
var that = this;
|
||||
client.post(evt, {dataType: 'html'}).then(function(response) {
|
||||
client.post(evt, {dataType: 'html'}).then(function (response) {
|
||||
that.$.find('.comment_edit_content').replaceWith(response.html);
|
||||
that.getRichtext().focus();
|
||||
that.$.find('.comment-cancel-edit-link').show();
|
||||
that.$.find('.comment-edit-link').hide();
|
||||
}).finally(function() {
|
||||
}).finally(function () {
|
||||
that.loader(false);
|
||||
});
|
||||
};
|
||||
|
||||
Comment.prototype.getRichtext = function() {
|
||||
|
||||
Comment.prototype.getRichtext = function () {
|
||||
return Widget.instance(this.$.find('div.humhub-ui-richtext'));
|
||||
};
|
||||
|
||||
Comment.prototype.delete = function() {
|
||||
this.super('delete', {modal: module.config.modal.delteConfirm}).then(function($confirm) {
|
||||
if($confirm) {
|
||||
Comment.prototype.delete = function () {
|
||||
this.super('delete', {modal: module.config.modal.delteConfirm}).then(function ($confirm) {
|
||||
if ($confirm) {
|
||||
module.log.success('success.delete');
|
||||
}
|
||||
}).catch(function(err) {
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
});
|
||||
};
|
||||
|
||||
Comment.prototype.editSubmit = function(evt) {
|
||||
Comment.prototype.editSubmit = function (evt) {
|
||||
var that = this;
|
||||
client.submit(evt, {dataType: 'html'}).then(function(response) {
|
||||
client.submit(evt, {dataType: 'html'}).then(function (response) {
|
||||
that.replace(response.html);
|
||||
that.highlight();
|
||||
that.$.find('.comment-cancel-edit-link').hide();
|
||||
that.$.find('.comment-edit-link').show();
|
||||
module.log.success('success.saved');
|
||||
}).catch(function(err) {
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
});
|
||||
};
|
||||
|
||||
Comment.prototype.replace = function(content) {
|
||||
Comment.prototype.replace = function (content) {
|
||||
var id = this.$.attr('id');
|
||||
this.$.replaceWith(content);
|
||||
this.$ = $('#' + id);
|
||||
additions.observe(this.$, true);
|
||||
};
|
||||
|
||||
Comment.prototype.cancelEdit = function(evt) {
|
||||
Comment.prototype.cancelEdit = function (evt) {
|
||||
var that = this;
|
||||
this.loader();
|
||||
client.html(evt).then(function(response) {
|
||||
client.html(evt).then(function (response) {
|
||||
that.replace(response.html);
|
||||
that.$.find('.comment-cancel-edit-link').hide();
|
||||
that.$.find('.comment-edit-link').show();
|
||||
}).catch(function(err) {
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
}).finally(function() {
|
||||
}).finally(function () {
|
||||
that.loader(false);
|
||||
});
|
||||
};
|
||||
|
||||
Comment.prototype.highlight = function() {
|
||||
Comment.prototype.highlight = function () {
|
||||
additions.highlight(this.$.find('.comment-message'));
|
||||
};
|
||||
|
||||
Comment.prototype.loader = function($show) {
|
||||
Comment.prototype.loader = function ($show) {
|
||||
var $loader = this.$.find('.comment-entry-loader');
|
||||
if($show === false) {
|
||||
if ($show === false) {
|
||||
this.$.find('.preferences').show();
|
||||
loader.reset($loader);
|
||||
return;
|
||||
@ -138,32 +154,53 @@ humhub.module('comment', function(module, require, $) {
|
||||
|
||||
this.$.find('.preferences').hide();
|
||||
};
|
||||
|
||||
var showAll = function(evt) {
|
||||
client.post(evt, {dataType:'html'}).then(function(response) {
|
||||
|
||||
var showAll = function (evt) {
|
||||
client.post(evt, {dataType: 'html'}).then(function (response) {
|
||||
var $container = evt.$trigger.parent();
|
||||
$container.html(response.html);
|
||||
additions.applyTo($container);
|
||||
}).catch(function(err) {
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
});
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
$(document).on('mouseover', '.comment .media', function() {
|
||||
var showMore = function (evt) {
|
||||
loader.set(evt.$trigger, {
|
||||
'size': '8px',
|
||||
'css': {
|
||||
padding: '2px',
|
||||
width: '60px'
|
||||
|
||||
}
|
||||
});
|
||||
client.post(evt, {dataType: 'html'}).then(function (response) {
|
||||
var $container = evt.$trigger.closest('.comment');
|
||||
var $html = $(response.html);
|
||||
$container.prepend($html);
|
||||
evt.$trigger.closest('.showMore').remove();
|
||||
additions.applyTo($html);
|
||||
}).catch(function (err) {
|
||||
module.log.error(err, true);
|
||||
loader.unset(evt.$trigger);
|
||||
});
|
||||
};
|
||||
|
||||
var init = function () {
|
||||
$(document).on('mouseover', '.comment .media', function () {
|
||||
var $this = $(this);
|
||||
var element = $this.find('.preferences');
|
||||
if(!loader.is($this.find('.comment-entry-loader'))) {
|
||||
if (!loader.is($this.find('.comment-entry-loader'))) {
|
||||
element.show();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('mouseout', '.comment .media', function() {
|
||||
$(document).on('mouseout', '.comment .media', function () {
|
||||
// find dropdown menu
|
||||
var element = $(this).find('.preferences');
|
||||
|
||||
// hide dropdown if it's not open
|
||||
if(!element.find('li').hasClass('open')) {
|
||||
if (!element.find('li').hasClass('open')) {
|
||||
element.hide();
|
||||
}
|
||||
});
|
||||
@ -173,6 +210,7 @@ humhub.module('comment', function(module, require, $) {
|
||||
init: init,
|
||||
Comment: Comment,
|
||||
Form: Form,
|
||||
showAll: showAll
|
||||
showAll: showAll,
|
||||
showMore: showMore
|
||||
});
|
||||
});
|
@ -41,10 +41,6 @@ humhub.module('content.form', function(module, require, $) {
|
||||
}
|
||||
};
|
||||
|
||||
CreateForm.prototype.actions = function() {
|
||||
return ['submit', 'notifyUser', 'changeVisibility'];
|
||||
};
|
||||
|
||||
CreateForm.prototype.submit = function(evt) {
|
||||
this.$.find("#contentFormError, .preferences, .fileinput-button").hide();
|
||||
this.$.find("#contentFormError li").remove();
|
||||
|
@ -135,7 +135,7 @@ humhub.module('content', function (module, require, $) {
|
||||
};
|
||||
|
||||
var templates = {
|
||||
permalinkBody: '<textarea rows="3" class="form-control permalink-txt" spellcheck="false" readonly>{permalink}</textarea><p class="help-block pull-right"><a href="#" onClick="clipboard.copy($(\'.permalink-txt\').text())"><i class="fa fa-clipboard" aria-hidden="true"></i> {info}</a></p>',
|
||||
permalinkBody: '<div class="clearfix"><textarea rows="3" class="form-control permalink-txt" spellcheck="false" readonly>{permalink}</textarea><p class="help-block pull-right"><a href="#" data-action-click="copyToClipboard" data-action-target=".permalink-txt"><i class="fa fa-clipboard" aria-hidden="true"></i> {info}</a></p></div>',
|
||||
permalinkFooter: '<a href="#" data-modal-close class="btn btn-default">{buttonClose}</a><a href="{permalink}" class="btn btn-primary" data-ui-loader>{buttonOpen}</a>'
|
||||
};
|
||||
|
||||
|
@ -344,6 +344,7 @@ humhub.module('file', function (module, require, $) {
|
||||
animation: 'fade',
|
||||
delay: 100,
|
||||
placement: this.options.popoverPosition || 'right',
|
||||
container: 'body',
|
||||
content: function () {
|
||||
return string.template(Preview.template.popover, file);
|
||||
}
|
||||
@ -356,11 +357,9 @@ humhub.module('file', function (module, require, $) {
|
||||
that.delete(file);
|
||||
});
|
||||
|
||||
if(this.isImage(file) && this.options.hideImageFileInfo) {
|
||||
$file.find('.file-fileInfo').remove();
|
||||
if(!(this.isImage(file) && this.options.hideImageFileInfo)) {
|
||||
$file.fadeIn();
|
||||
}
|
||||
|
||||
$file.fadeIn();
|
||||
};
|
||||
|
||||
Preview.prototype.isImage = function (file) {
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user