#633 Add Emoji support
This commit is contained in:
parent
d464d3b0c3
commit
3b0c2cb480
888 changed files with 127 additions and 85 deletions
|
@ -14,7 +14,9 @@ function initCommentPreviewTab($form) {
|
|||
"text": $form.find('.tab.segment[data-tab="' + $tab_menu.data('write') + '"] textarea').val()
|
||||
},
|
||||
function (data) {
|
||||
$form.find('.tab.segment[data-tab="' + $tab_menu.data('preview') + '"]').html(data);
|
||||
var $preview_tab = $form.find('.tab.segment[data-tab="' + $tab_menu.data('preview') + '"]');
|
||||
$preview_tab.html(data);
|
||||
emojify.run($preview_tab[0]);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -43,14 +45,14 @@ function initCommentForm() {
|
|||
|
||||
$label_menu.find('.item:not(.no-select)').click(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
$(this).removeClass('checked')
|
||||
$(this).find('.octicon').removeClass('octicon-check')
|
||||
$(this).removeClass('checked');
|
||||
$(this).find('.octicon').removeClass('octicon-check');
|
||||
if (has_label_update_action) {
|
||||
updateIssueMeta($label_menu.data('update-url'), "detach", $(this).data('id'));
|
||||
}
|
||||
} else {
|
||||
$(this).addClass('checked')
|
||||
$(this).find('.octicon').addClass('octicon-check')
|
||||
$(this).addClass('checked');
|
||||
$(this).find('.octicon').addClass('octicon-check');
|
||||
if (has_label_update_action) {
|
||||
updateIssueMeta($label_menu.data('update-url'), "attach", $(this).data('id'));
|
||||
}
|
||||
|
@ -92,7 +94,7 @@ function initCommentForm() {
|
|||
|
||||
function selectItem(select_id, input_id) {
|
||||
var $menu = $(select_id + ' .menu');
|
||||
var $list = $('.ui' + select_id + '.list')
|
||||
var $list = $('.ui' + select_id + '.list');
|
||||
var has_update_action = $menu.data('action') == 'update';
|
||||
|
||||
$menu.find('.item:not(.no-select)').click(function () {
|
||||
|
@ -175,7 +177,7 @@ function initInstall() {
|
|||
$('#disable-gravatar').checkbox('check');
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function initRepository() {
|
||||
if ($('.repository').length == 0) {
|
||||
|
@ -209,7 +211,7 @@ function initRepository() {
|
|||
$(this).minicolors();
|
||||
});
|
||||
$('.precolors .color').click(function () {
|
||||
var color_hex = $(this).data('color-hex')
|
||||
var color_hex = $(this).data('color-hex');
|
||||
$('.color-picker').val(color_hex);
|
||||
$('.minicolors-swatch-color').css("background-color", color_hex);
|
||||
});
|
||||
|
@ -231,7 +233,7 @@ function initRepository() {
|
|||
|
||||
}
|
||||
if ($('.repository.new.milestone').length > 0) {
|
||||
var $datepicker = $('.milestone.datepicker')
|
||||
var $datepicker = $('.milestone.datepicker');
|
||||
$datepicker.datetimepicker({
|
||||
lang: $datepicker.data('lang'),
|
||||
inline: true,
|
||||
|
@ -260,7 +262,7 @@ function initRepository() {
|
|||
$('.in-edit').toggle();
|
||||
$edit_input.focus();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$('#edit-title').click(editTitleToggle);
|
||||
$('#cancel-edit-title').click(editTitleToggle);
|
||||
$('#save-edit-title').click(editTitleToggle).
|
||||
|
@ -374,7 +376,7 @@ function initRepository() {
|
|||
|
||||
// Pull request
|
||||
if ($('.repository.compare.pull').length > 0) {
|
||||
var $branch_dropdown = $('.choose.branch .dropdown')
|
||||
var $branch_dropdown = $('.choose.branch .dropdown');
|
||||
$branch_dropdown.dropdown({
|
||||
fullTextSearch: true,
|
||||
onChange: function (text, value, $choice) {
|
||||
|
@ -383,7 +385,7 @@ function initRepository() {
|
|||
message: {noResults: $branch_dropdown.data('no-results')}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function initWebhook() {
|
||||
if ($('.new.webhook').length == 0) {
|
||||
|
@ -470,7 +472,7 @@ $(document).ready(function () {
|
|||
this.on("success", function (file, data) {
|
||||
filenameDict[file.name] = data.uuid;
|
||||
$('.attachments').append('<input id="' + data.uuid + '" name="attachments" type="hidden" value="' + data.uuid + '">');
|
||||
})
|
||||
});
|
||||
this.on("removedfile", function (file) {
|
||||
if (file.name in filenameDict) {
|
||||
$('#' + filenameDict[file.name]).remove();
|
||||
|
@ -480,6 +482,14 @@ $(document).ready(function () {
|
|||
});
|
||||
}
|
||||
|
||||
// Emojify
|
||||
emojify.setConfig({
|
||||
img_dir:'/img/emoji'
|
||||
});
|
||||
$('.markdown').each(function(){
|
||||
emojify.run($(this)[0]);
|
||||
});
|
||||
|
||||
// Helpers.
|
||||
$('.delete-button').click(function () {
|
||||
var $this = $(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue