forked from Wachhund/myimouto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Parziphal
committed
Oct 26, 2013
1 parent
f4c03a4
commit 13227f0
Showing
768 changed files
with
72,005 additions
and
18,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Place your application-specific JavaScript functions and classes here | ||
// This file is automatically included by javascript_include_tag :defaults | ||
// | ||
//= require prefix | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require jquery.cookie | ||
//= require jquery.ui.autocomplete | ||
//= require compat.jquery | ||
//= require mousetrap | ||
//= require i18n | ||
//= require i18n/translations | ||
//= require i18n_scopify | ||
//= require cookie | ||
//= require dmail | ||
//= require favorite | ||
//= require forum | ||
//= require user_record | ||
//= require_tree . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
(function($, t) { | ||
Comment = { | ||
spoiler: function(obj) { | ||
var text = $(obj).next('.spoilertext'); | ||
var warning = $(obj).children('.spoilerwarning'); | ||
obj.hide(); | ||
text.show(); | ||
}, | ||
|
||
flag: function(id) { | ||
if(!confirm(t('.flag_ask'))) | ||
return; | ||
|
||
notice(t('.flag_process')) | ||
|
||
$.ajax({ | ||
url: Moebooru.path('/comment/mark_as_spam.json'), | ||
type: 'post', | ||
data: { | ||
'id': id, | ||
'comment[is_spam]': 1 | ||
} | ||
}).done(function(resp) { | ||
notice(t('.flag_notice')); | ||
}).fail(function(resp) { | ||
var resp = $.parseJSON(resp.responseText) | ||
notice(t('js.error') + resp.reason); | ||
}) | ||
}, | ||
|
||
quote: function(id) { | ||
$.ajax({ | ||
url: Moebooru.path('/comment/show.json'), | ||
type: 'get', | ||
data: { | ||
'id': id | ||
} | ||
}).done(function(resp) { | ||
var stripped_body = resp.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\](?:\r\n|\r|\n)*/gm, '') | ||
var body = '[quote]' + resp.creator + ' said:\n' + stripped_body + '\n[/quote]\n\n' | ||
$('#reply-' + resp.post_id).show() | ||
if ($('#respond-link-' + resp.post_id)) { | ||
$('#respond-link-' + resp.post_id).hide() | ||
} | ||
var reply_box = $('#reply-text-' + resp.post_id) | ||
reply_box.val(reply_box.val() + body); | ||
reply_box.focus(); | ||
}).fail(function() { | ||
notice(t('.quote_error')) | ||
}); | ||
}, | ||
|
||
destroy: function(id) { | ||
if (!confirm(t('.delete_ask')) ) { | ||
return; | ||
} | ||
$.ajax({ | ||
url: Moebooru.path('/comment/destroy.json'), | ||
type: 'post', | ||
data: { 'id': id } | ||
}).done(function(resp) { | ||
document.location.reload() | ||
}).fail(function(resp) { | ||
var resp = $.parseJSON(resp.responseText) | ||
notice(t('.delete_error') + resp.reason) | ||
}); | ||
}, | ||
|
||
show_reply_form: function(post_id) | ||
{ | ||
$('#respond-link-' + post_id).hide(); | ||
$('#reply-' + post_id).show(); | ||
$('#reply-' + post_id).find('textarea').focus(); | ||
} | ||
} | ||
}) (jQuery, I18n.scopify('js.comment')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jQuery.noConflict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(function($) { | ||
$.cookie.defaults['path'] = PREFIX; | ||
}) (jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// FIXME: I think the correct way would be replacing all calls to this | ||
// with jQuery.cookie. | ||
(function($) { | ||
$.cookie.defaults['path'] = PREFIX; | ||
$.cookie.defaults['expires'] = 365; | ||
Cookie = { | ||
put: function(name, value, days) { | ||
var options = null; | ||
if (days) { | ||
options = { expires: days }; | ||
}; | ||
$.cookie(name, value, options); | ||
}, | ||
|
||
get: function(name) { | ||
// FIXME: compatibility reason. Should sweep this with !! check | ||
// or something similar in relevant codes. | ||
return $.cookie(name) || ''; | ||
}, | ||
|
||
get_int: function(name) { | ||
parseInt($.cookie(name)); | ||
}, | ||
|
||
remove: function(name) { | ||
$.removeCookie(name); | ||
}, | ||
|
||
unescape: function(value) { | ||
return window.decodeURIComponent(value.replace(/\+/g, " ")) | ||
} | ||
}; | ||
}) (jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function($) { | ||
Dmail = { | ||
respond: function(to) { | ||
$('#dmail_to_name').val(to); | ||
var stripped_body = $('#dmail_body').val().replace(/\[quote\](?:.|\n)+?\[\/quote\]\n*/gm, ""); | ||
$('#dmail_body').val("[quote]You said:\n" + stripped_body + "\n[/quote]\n\n"); | ||
$('#response').show(); | ||
}, | ||
|
||
expand: function(parent_id, id) { | ||
notice("Fetching previous messages...") | ||
|
||
$.ajax({ | ||
url: Moebooru.path('/dmail/show_previous_messages'), | ||
type: 'get', | ||
data: { | ||
"id": id, | ||
"parent_id": parent_id | ||
} | ||
}).done(function(data) { | ||
$('#previous-messages').html(data); | ||
$('#previous-messages').show(); | ||
notice('Previous messages loaded'); | ||
}) | ||
} | ||
} | ||
}) (jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(function($) { | ||
Favorite = { | ||
link_to_users: function(users) { | ||
var html = "" | ||
|
||
if (users.size() == 0) { | ||
return "no one" | ||
} else { | ||
html = users.slice(0, 6).map(function(x) {return '<a href="/user/show/' + x.id + '">' + x.name + '</a>'}).join(", ") | ||
|
||
if (users.size() > 6) { | ||
html += '<span id="remaining-favs" style="display: none;">' + users.slice(6, -1).map(function(x) {return '<a href="/user/show/' + x.id + '">' + x.name + '</a>'}).join(", ") + '</span> <span id="remaining-favs-link">(<a href="#" onclick="$(\'remaining-favs\').show(); $(\'remaining-favs-link\').hide(); return false;">' + (users.size() - 6) + ' more</a>)</span>' | ||
} | ||
|
||
return html | ||
} | ||
} | ||
} | ||
}) (jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(function($) { | ||
Forum = { | ||
mark_all_read: function() { | ||
$.ajax({ | ||
url: Moebooru.path('/forum/mark_all_read'), | ||
}).done(function() { | ||
$('span.forum-topic').removeClass('unread-topic'); | ||
$('div.forum-update').removeClass('forum-update'); | ||
Menu.sync_forum_menu(); | ||
notice("Marked all topics as read"); | ||
}); | ||
}, | ||
quote: function(id) { | ||
$.ajax({ | ||
url: Moebooru.path('/forum/show.json'), | ||
type: 'get', | ||
data: { | ||
'id': id | ||
} | ||
}).done(function(resp) { | ||
var stripped_body = resp.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm, ''); | ||
$('#reply').show(); | ||
$('#forum_post_body').val(function(i, val) { return val + '[quote]' + resp.creator + ' said:\n' + stripped_body + '\n[/quote]\n\n'; }); | ||
if($('#respond-link')) | ||
$('#respond-link').hide(); | ||
if($('#forum_post_body')) | ||
$('#forum_post_body').focus(); | ||
}).fail(function() { | ||
notice("Error quoting forum post"); | ||
}); | ||
} | ||
} | ||
}) (jQuery); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(function () { | ||
I18n.scopify = function (scope) { | ||
return function (label, options) { | ||
if (label.charAt(0) == '.') | ||
label = scope + label; | ||
return I18n.t(label, options); | ||
} | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php $url = Rails::application()->router()->url_helpers() ?> | ||
jQuery(document).ready(function($) { | ||
$('input.ac-user-name').autocomplete({ | ||
source: '<?= $url->acUserNamePath() ?>', | ||
minLength: 2 | ||
}); | ||
$('input.ac-tag-name').autocomplete({ | ||
source: '<?= $url->acTagNamePath() ?>', | ||
minLength: 2 | ||
}); | ||
if ($('#edit-form').length && $('textarea.ac-tags').length) { | ||
new TagCompletionBox($('textarea.ac-tags')[0]); | ||
if (TagCompletion) { | ||
TagCompletion.observe_tag_changes_on_submit($('#edit-form')[0], $('input.ac-tags')[0], null); | ||
}; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
jQuery(document).ready(function($) { | ||
// Check if there's new dmail. | ||
if ($.cookie('has_mail') == '1') { | ||
$('#has-mail-notice').show(); | ||
}; | ||
|
||
// Check if there's new comment. | ||
if ($.cookie('comments_updated') == '1') { | ||
$('#comments-link').addClass('comments-update') | ||
$('#comments-link').addClass('bolded'); | ||
}; | ||
|
||
// Show block/ban reason if the user is blocked/banned. | ||
if ($.cookie('block_reason') && $.cookie('block_reason') != '') { | ||
$('#block-reason').text($.cookie('block_reason')).show(); | ||
}; | ||
|
||
// Check if there's any pending post moderation queue. | ||
if (parseInt($.cookie('mod_pending')) > 0) { | ||
$('#moderate').addClass('mod-pending'); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
jQuery(document).ready(function($) { | ||
Menu.init(); | ||
$(document).on('click', '#main-menu .search-link', function(e) { return Menu.show_search_box(e.currentTarget); }); | ||
$(document).on('click', Menu.toggle); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jQuery(document).ready(function($) { | ||
MenuDragDrop.init(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jQuery(document).ready(function($) { | ||
if ($.cookie('hide-news-ticker') !== '1') { | ||
$('#news-ticker').show(); | ||
$('#close-news-ticker-link').on('click', function() { | ||
$('#news-ticker').hide(); | ||
$.cookie('hide-news-ticker', '1', { | ||
expires: 7 | ||
}); | ||
return false; | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
jQuery(document).ready(function($) { | ||
$('#post_tags').val( | ||
$.map($('li.tag-link'), | ||
function(t, _) { return $(t).data('name'); } | ||
).join(' ') | ||
); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.