Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
#88 - more comments for albums
Browse files Browse the repository at this point in the history
  • Loading branch information
nizsheanez committed Nov 1, 2012
1 parent dbb0b32 commit 1af0e17
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
21 changes: 13 additions & 8 deletions js/comments/commentsPortlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ $.widget('cmsUI.commentList', {
widget.label = $(widget.options.label_selector, widget.element);
widget.list = $(widget.options.comments_list_selector, widget.element);

var $loading_div = $('<div>загрузка комментариев...</div>').css('text-align', 'center');

widget.list.html($loading_div);

widget.setLoading();
widget._initAnswers();
widget._initForm();
if (!widget.options.is_hidden)
Expand All @@ -36,6 +33,11 @@ $.widget('cmsUI.commentList', {
$("input[name='Comment[object_id]']", widget.form).val(link.data('object-id'));
widget.form.attr('action', link.data('comments-url'));
},
setLoading: function() {
var widget = this;
var $loading_div = $('<div>загрузка комментариев...</div>').css('text-align', 'center');
widget.list.html($loading_div);
},
_initForm:function()
{
var widget = this;
Expand Down Expand Up @@ -85,13 +87,16 @@ $.widget('cmsUI.commentList', {
update_url = opts.url;
}

var oid = $("input[name='Comment[object_id]']", widget.form).val(),
mid = $("input[name='Comment[model_id]']", widget.form).val();

$.get(update_url, {
object_id : $("input[name='Comment[object_id]']", widget.form).val(),
model_id : $("input[name='Comment[model_id]']", widget.form).val()
object_id : oid,
model_id : mid
},
function(html)
{
widget.list.html(html);
});
}, 'html');
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,19 @@

var layer_margin = $('#layer-margin').length ? $('#layer-margin') : $('<div id="layer-margin">').css('height', '100px');
$('.fancybox-wrap').prependTo(overlay).append(layer_margin);

//comments
var comments_widget = $('#' + opts.comment_widget_id);
F.current.skin.append(comments_widget.show());
comments_widget.commentList('bindTo', F.current.element);
comments_widget.commentList('setLoading');
comments_widget.commentList('loadCommentsList', {
url: F.current.element.data('comments-url')
});
},
beforeClose: function()
beforeClose: function(opts)
{
$('body').append($('#' + opts.comment_widget_id).hide());
$('.fancybox-overlay').css('overflow-y', 'hidden');
},
afterClose: function ()
Expand Down
6 changes: 6 additions & 0 deletions protected/modules/media/controllers/MediaVideoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ public static function actionsTitles()
"manage" => "Поиск видео",
"view" => "Просмотр видео",
"autocomplete" => "Скачать файл",
"v" => "Скачать файл",
];
}

public function actionV()
{
echo 'alert(5); '.$_GET['callback'] . '({content:4})';
}


public function actionAutocomplete($term)
{
Expand Down

0 comments on commit 1af0e17

Please sign in to comment.