Изменения

Перейти к навигации Перейти к поиску
нет описания правки
Строка 34: Строка 34:  
}, 0);
 
}, 0);
 
}
 
}
 +
 +
var publishDialog = this.publishDialog = $('<div id="commentsToVkDialog" title="Добавить комментарий в очередь"></div>')
 +
var publishForm = $('<form></form>')
 +
publishForm.appendTo(publishDialog);
 +
 +
var publishFormFieldset = $('<fieldset></fieldset>')
 +
publishFormFieldset.appendTo(publishForm);
 +
 +
var publishFormText = this.publishFormText = $('<textarea rows="10" cols="80"></textarea>')
 +
publishFormText.appendTo(publishFormFieldset);
 +
 +
var publishFormLink = this.publishFormLink = $('<input type="url"></input>')
 +
publishFormLink.appendTo(publishFormFieldset);
 +
 +
var publishFormTime = this.publishFormTime = $('<input type="datetime"></input>')
 +
publishFormTime.appendTo(publishFormFieldset);
 +
 +
publishDialog.dialog({
 +
autoOpen : false,
 +
height : 'auto',
 +
width : 'auto',
 +
modal : true,
 +
buttons : {
 +
Submit : function() {
 +
 +
},
 +
Cancel : function() {
 +
publishDialog.dialog("close");
 +
}
 +
},
 +
});
 
}
 
}
   Строка 53: Строка 84:  
var instance = this;
 
var instance = this;
   −
$(".c-item").each(function(item) {
+
$(".c-item").each(function(index, item) {
 
var container = $(item).find(".c-container");
 
var container = $(item).find(".c-container");
   Строка 61: Строка 92:  
instance.dialogPublish($(item));
 
instance.dialogPublish($(item));
 
});
 
});
 +
container.append($("<br>"));
 
container.append(btnPublish);
 
container.append(btnPublish);
 
});
 
});
 
}
 
}
   −
CommentToVk.prototype.dialogPublish = function() {
+
CommentToVk.prototype.dialogPublish = function(cItem) {
 +
var container = $(cItem).find(".c-container");
 +
var comment = $(cItem).find(".c-comment");
 +
var link = $(container.find("a")[0]).attr('href');
 +
link = link.split('#')[0];
 +
var text = comment.text();
    +
this.publishFormText.val(text);
 +
this.publishFormLink.val(link);
 +
this.publishDialog.dialog('open');
 
}
 
}
    
if (wgArticleId == 5168) {
 
if (wgArticleId == 5168) {
var instance = new CommentToVk();
+
new CommentToVk();
 
}
 
}
 
})();
 
})();
Анонимный участник

Навигация