Skip to content
  • 12 commits
  • 39 files changed
  • 0 commit comments
  • 4 contributors
View
10 config.pl.sample
@@ -20,27 +20,27 @@ use strict;
introduction => 'テストサーバ',
auth_endpoint => { # endpoint => [ $module_name, $args, $description_for_client ]
'/login' => [
- 'Simple' => {
+ 'Yancha::Auth::Simple' => {
name_field => 'nick'
} => { description => 'Test!' },
],
'/login/basic' => [
- 'BasicAuth' => {
+ 'Yancha::Auth::BasicAuth' => {
passwd_file => '.htpasswd',
check_hashes => ['plain','crypt','md5','sha1'],
realm => 'Hachioji.pm',
} => { description => 'Basic認証' },
],
'/login/twitter' => [
- 'Twitter' => {
+ 'Yancha::Auth::Twitter' => {
consumer_key => 'xxxx',
consumer_secret => 'yyyy',
}, => { description => 'Twitter!' },
],
},
api_endpoint => {
- '/api/post' => [ 'Post' => {} => 'user message投稿用api' ],
- '/api/search' => [ 'Search' => {} => 'user message検索用api' ],
+ '/api/post' => [ 'Yancha::API::Post' => {} => 'user message投稿用api' ],
+ '/api/search' => [ 'Yancha::API::Search' => {} => 'user message検索用api' ],
},
},
View
3 lib/Yancha.pm
@@ -85,8 +85,7 @@ sub build_psgi_endpoint_from_server_info {
Plack::Builder->import;
for my $endpoint ( keys %{ $conf } ) {
my ( $module_name, $arg, undef ) = @{ $conf->{ $endpoint } };
- my $type = length $name <= 3 ? uc( $name ) : ucfirst( $name ); # API対策…いけてない
- my $module = $self->load_module( $type => $module_name );
+ my $module = $self->load_module( $module_name );
unless ( $module->can('build_psgi_endpoint') ) {
Carp::croak( "$module must have build_psgi_endpoint." );
}
View
19 public/android.html
@@ -45,13 +45,15 @@
<div id="nickname">
<br />
- <form id="set-nickname" class="wrap">
- <p>Please login by ...</p>
- <p><a href="/login/twitter/start">Twitter</a></p>
- </form>
+ <p>yancha chatに参加するには、ログインして下さい。</p>
+ <p><a href="/login/twitter/start">Twitterでログイン</a></p>
<form action="./login" method="post">
- <p>or simple login</p><input type="text" name="nick"><input type="submit" name="login" value="login">
+ <p>または…シンプルログイン</p>
+ ニックネーム<input type="text" name="nick"><input type="submit" name="login" value="login">
</form>
+ <br>
+ <br>
+ <a href="https://github.com/uzulla/yancha" target="_blank">yanchaについて</a>
</div>
<div id="loading">
@@ -123,7 +125,8 @@
</div>
SETTINGS
<div style="border-bottom:1px #999 solid;padding:3px;">
- <label><input type="checkbox" id="sound" checked=checked>音をならす</label>
+ <label><input type="checkbox" id="sound" checked=checked>音をならす</label><br>
+ <label><input type="checkbox" id="disp_announcement">サーバーメッセージを表示</label>
</div>
ACTIONS
<div style="border-bottom:1px #999 solid;padding:3px;">
@@ -150,6 +153,10 @@
・画像ポスト<br>
<a href="http://yairc.cfe.jp:5000/" target="_blank">http://yairc.cfe.jp:5000/</a>
</div>
+ ABOUT<br>
+ <div style="font-size:80%; border-bottom:1px #999 solid;padding:3px;font-size:80%">
+ <a href="https://github.com/uzulla/yancha" target="_blank">yanchaについて</a>
+ </div>
</tr>
<tr>
View
112 public/chat.html
@@ -51,68 +51,84 @@
<body>
<form action="#" target="_blank" method="post" id="popuper"></form>
- <div id="nickname">
- <br />
- <form id="set-nickname" class="wrap">
- <p>Please login by ...</p>
- <p><a href="/login/twitter/start">Twitter</a></p>
- </form>
- <form action="./login" method="post">
- <p>or simple login</p><input type="text" name="nick"><input type="submit" name="login" value="login">
- </form>
+ <div id="nickname" style="background-color:#bfd8e7;">
+ <div class="header" style="text-align:right; background-color:#004065">
+ <img src="img/header_logo.png">
+ </div>
+
+ <div class="content" style="width:600px;margin-left:auto;margin-right:auto;margin-top:50px;">
+ <div style="float:left;text-align:left">
+ <img src="img/login_text_snsaccountlogin.gif" alt="SNSアカウントでログイン" width="" height="" style="margin-bottom:10px;" /><br>
+ <a href="/login/twitter/start"><img src="img/login_btn_twitterlogin.gif" alt="login_btn_twitterlogin" width="" height="" /></a><br>
+
+
+ <img src="img/login_text_simplelogin.gif" alt="ニックネームでログイン" width="" height="" style="margin-top:30px;margin-bottom:10px;" />
+ <form action="./login" method="post" style="padding:0px;margin:0px;font-size:0.01em;">
+ <input type="text" name="nick" style="padding:0px;margin:0px;height:35px;border:0px;font-size:14px;">
+ <input type="image" src="img/login_btn_simplelogin.gif" alt="ログイン" style="height:35px;padding:0px;margin:0px;vertical-align: top;border:0px;"/>
+ </form>
+ </div>
+ <div style="float:right" >
+ <img src="img/login_text_info.gif" alt="info" width="" height="" /><br>
+ <ul style="text-align:left;padding-left:20px;">
+ <li>本サイトはyanchaのサンプルです</li>
+ <li><a href="https://github.com/uzulla/yancha" target="_blank">yanchaについて</a></li>
+ <li><a href="http://hachiojipm.org/" target="_blank">開発 hachioji.pm</a></li>
+ <li><a href="http://twitter.com/uzulla/" target="_blank">テストサイト管理者@uzulla</a></li>
+ </ul>
+
+ </div>
+
+ </div>
+ <br style="clear:both">
</div>
- <div id="loading">
+ <div id="loading" style="background-color:#bfd8e7;">
<div class="wrap">please wait...</div>
</div>
- <div id="connecting">
+ <div id="connecting" style="background-color:#bfd8e7;">
<div class="wrap">Connecting to server...</div>
</div>
<div id="infomation">
- ONLINE
+ <div class="header" style="text-align:right; background-color:#004065">
+ <img src="img/header_logo.png">
+ </div>
+
+ <img src="img/chat_h_online.gif" alt="online" width="" height="" />
<div id="nicknames">
</div>
- TAGS
+ <img src="img/chat_h_tags.gif" alt="tags" width="" height="" />
+ <div id="tags">
+ </div>
<table>
<tr>
<td>
- <input id="tagname" type="text" style="width:100px">
+ <input id="tagname" type="text" style="width:100px;height:25px;margin:0px;padding:0px;border:0px;">
<td style="width:50px">
- <button onclick="addTag($('#tagname').val());$('#tagname').val('');return false;">追加</button>
+ <input type=image src="img/chat_btn_tagadd.gif" onclick="addTag($('#tagname').val());$('#tagname').val('');return false;" style="vertical-align:top;height:25px;margin:0px;padding:0px;border:0px;">
</table>
- <span style="font-size:60%;">※クリックでOn/Off</span>
- <div id="tags">
- </div>
- SETTINGS
- <div style="border-bottom:1px #999 solid;padding:3px;">
- <label><input type="checkbox" id="sound" checked=checked>音をならす</label>
+ <img src="img/chat_h_settings.gif" alt="settings" width="" height="" />
+ <div style="3px;padding-left:5px;">
+ <ul style="list-style-type:none;padding:0px;margin:0px;">
+ <li style="float:left"><img src="img/chat_sw_notice.gif" alt="notice" width="" height="" class="virtualcheckbox" id="disp_announcement" onclick="toggleVirtualCheckbox(event)" /><li>
+ <li style="margin-left:5px;float:left"><img src="img/chat_sw_sound.gif" alt="sound" width="" height="" class="virtualcheckbox" id="sound" checked=checked onclick="toggleVirtualCheckbox(event)" checked="checked" /><li>
+ </ul><br style="clear:both">
</div>
- ACTIONS
- <div style="border-bottom:1px #999 solid;padding:3px;">
- <button onclick="startSelectPost()">引用選択開始</button>
- <button onclick="endSelectPost()">引用選択完了</button>
- <button onclick="logout()">ログアウト</button>
+ <img src="img/chat_h_action.gif" alt="action" width="" height="" />
+ <div style="3px; padding-left:5px;">
+ <a href="pc_hints.html"><img src="img/chat_btn_hints.gif" alt="chat_btn_hints" width="" height="" class="onclk"/></a>
+ <img src="img/chat_btn_logout.gif" alt="chat_btn_logout" width="" height="" class="onclk" onclick="logout()"/>
+ <a href="search.html"><img src="img/chat_btn_logsearch.gif" alt="chat_btn_logsearch" width="" height=""/></a>
+ <img src="img/chat_sw_select.gif" alt="chat_sw_select" width="" class="virtualcheckbox" height="" class="onclk virtualcheckbox" onclick="startOrEndSelectPost(event);"/>
<button class="toggleNotify">デスクトップ通知切換</button>
</div>
- HINTS<br>
- <a href="/search.html" target="_blank" style="font-size:80%;">過去ログ</a><br>
- <div style="font-size:80%; border-bottom:1px #999 solid;padding:3px;font-size:80%">
- Shift+Enterで改行<br>
- ・コードハイライト<br>
- &gt;|javascript|<br>
- CODE<br>
- ||&lt;<br>
- &gt;|perl|<br>
- CODE<br>
- ||&lt;<br>
- ・PRE<br>
- &gt;&gt;<br>
- テキスト<br>
- &lt;&lt;<br>
- ・画像ポスト<br>
- <a href="http://yairc.cfe.jp:5000/" target="_blank">http://yairc.cfe.jp:5000/</a>
+ <img src="img/chat_h_info.gif" alt="action" width="" height="" />
+ <div style="font-size:80%; 3px;font-size:80%">
+ <ul style="padding-left:20px">
+ <li><a href="https://github.com/uzulla/yancha" target="_blank">yanchaについて</a></li>
+ </ul>
</div>
</div>
@@ -126,11 +142,11 @@
</div>
<form id="send-message">
- <table style="width:100%">
- <tr>
- <td style="width:100%"><textarea id="message"></textarea>
- <td ><button style="margin:2px 0px 2px 2px;">Send</button>
- <td ><button style="margin:2px 0px 2px 2px;" onclick='$("#infomation").toggle("slow");'>MENU</button>
+ <table style="width:100%;padding:0px;border:0px;margin:0px;background-color:#004065;border-collapse:collapse">
+ <tr style="padding:0px;border:0px;margin:0px;">
+ <td style="width:100%;padding:0px;padding:0px;border:0px;margin:0px;"><textarea id="message"></textarea>
+ <td style="width:100%;padding:0px;padding:0px;border:0px;margin:0px;border-left:1px solid white;"><input type="image" src="img/chat_btn_send.gif" style="margin:0px;padding:0px;border:0px;vertical-align:top;">
+ <td style="width:100%;padding:0px;padding:0px;border:0px;margin:0px;border-left:1px solid white;"><img src="img/chat_btn_menu.gif" onclick='$("#infomation").toggle("slow");' class="onclk" style="vertical-align:top;">
</table>
</form>
View
BIN public/img/chat_btn_hints.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_btn_logout.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_btn_logsearch.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_btn_menu.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_btn_send.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_btn_tagadd.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_h_action.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_h_info.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_h_online.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_h_settings.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_h_tags.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_notice.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_notice_on.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_select.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_select_on.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_sound.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/chat_sw_sound_on.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/header_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/login_btn_simplelogin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/login_btn_twitterlogin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/login_text_info.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/login_text_simplelogin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/img/login_text_snsaccountlogin.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
15 public/js/connection.js
@@ -3,8 +3,7 @@ var data = {
token:false,
nick:false,
profile_image_url:false,
- tags:{PUBLIC:0},
- announcement:true
+ tags:{PUBLIC:0}
};
//各種接続、切断、エラーイベント
@@ -34,7 +33,7 @@ socket.on('announcement', function (msg) {
});
function announcement(msg){
- if(data.announcement){
+ if($('#disp_announcement').attr('checked')){
var cell = $('#template_announcementcell').clone().removeAttr('id');
$('.announcementcell_text', cell).text(msg);
$('.announcementcell_text', cell).html( $('.announcementcell_text', cell).html().replace(/(\r|\n)/g, '<br />') );
@@ -232,8 +231,7 @@ socket.on('join tag', function(tags){
elm.addClass('disable_tag');
}
tagRefresh();
- }),
- $("<br />")
+ })
);
}
$(window).resize();
@@ -277,8 +275,13 @@ function addTag(newtag){
//console.log(newtag);
if(!data.tags[newtag]){
data.tags[newtag] = 0;
- }
+ }
sendTags();
+
+ var re = new RegExp('#'+newtag+'( |$)', "i");
+ if(!$('#message').val().match(re)){
+ $('#message').val($('#message').val()+' #'+newtag);
+ }
}
//send tag
View
92 public/js/filter.js
@@ -1,48 +1,48 @@
function user_message_filter(message){
- //auto inline display(pyazo)
- message = message.replace(/http(s)?:\/\/yairc.cfe.jp:5000(\/[\x21-\x7e]+)/gi, "<a href='//yairc.cfe.jp:5000$2' target='_blank'><img src='//yairc.cfe.jp:5000$2' style='max-width:300px;max-height:300px;'/></a>");
-
- // YT thumbnail
- message = message.replace(/http(s)?:\/\/www.youtube.com\/[\x21-\x7e]*v=([a-zA-Z0-9\-]+)/g, "<img src='//i1.ytimg.com/vi/$2/default.jpg'><br />http://www.youtube.com/watch?v=$2");
-
- //auto link
- message = message.replace(/(http(s)?:\/\/[\x21-\x7e]+)/gi, "<a href='$1' target='_blank'>$1</a>");
-
- message = message.replace(/&#62;\|javascript\|\n([\s\S]*?)\n\|\|&#60;/g,
- function(whole,s1) {
-    return( '<pre class="sh_javascript">' + s1 + '</pre>' );
-   }
- );
-
- var foundShHighlight = false;
-
- message = message.replace(/&#62;\|perl\|\n([\s\S]*?)\n\|\|&#60;/g,
- function(whole,s1) {
-    return( '<pre class="sh_perl">' + s1 + '</pre>' );
-   }
- );
-
- message = message.replace(/&#62;\|AA\|\n([\s\S]*?)\n\|\|&#60;/gi,
- function(whole,s1) {
-    return( '<pre style=\'font-family: "MS Pゴシック","MS ゴシック","MS Pゴシック","MS ゴシック",sans-serif;\'>' + s1 + '</pre>' );
-   }
- );
-
- message = message.replace(/&#62;\|\|\n([\s\S]*?)\n\|\|&#60;/g,
- function(whole,s1) {
-    return( '<pre>' + s1 + '</pre>' );
-   }
- );
-
- message = message.replace(/&#62;&#62;\n([\s\S]*?)\n&#60;&#60;/g,
- function(whole,s1) {
-    return( '<pre>' + s1 + '</pre>' );
-   }
- );
-
- message = message.replace(/\n/g, "<br />");
-
- return message;
-
-}
+ //auto inline display(pyazo)
+ message = message.replace(/http(s)?:\/\/yairc.cfe.jp:5000(\/[\x21-\x7e]+)/gi,
+ "<a href='//yairc.cfe.jp:5000$2' target='_blank'><img src='//yairc.cfe.jp:5000$2' style='max-width:300px;max-height:300px;'/></a>");
+
+ // YT thumbnail
+ message = message.replace(/http(s)?:\/\/www.youtube.com\/[\x21-\x7e]*v=([a-zA-Z0-9\-]+)/g,
+ "<img src='//i1.ytimg.com/vi/$2/default.jpg'><br />http://www.youtube.com/watch?v=$2");
+
+ //auto link
+ message = message.replace(/(http(s)?:\/\/[\x21-\x7e]+)/gi, "<a href='$1' target='_blank'>$1</a>");
+
+ message = message.replace(/&#62;\|javascript\|\n([\s\S]*?)\n\|\|&#60;/g, function(whole,s1) {
+ return( '<pre class="sh_javascript">' + s1 + '</pre>' );
+ });
+
+ var foundShHighlight = false;
+
+ message = message.replace(/&#62;\|perl\|\n([\s\S]*?)\n\|\|&#60;/g, function(whole,s1) {
+ return( '<pre class="sh_perl">' + s1 + '</pre>' );
+ });
+
+ message = message.replace(/&#62;\|AA\|\n([\s\S]*?)\n\|\|&#60;/gi, function(whole,s1) {
+ return( '<pre style=\'font-family: "MS Pゴシック","MS ゴシック","MS Pゴシック","MS ゴシック",sans-serif;\'>'
+ + s1
+ + '</pre>'
+ );
+ });
+
+ message = message.replace(/&#62;\|\|\n([\s\S]*?)\n\|\|&#60;/g, function(whole,s1) {
+ return( '<pre>' + s1 + '</pre>' );
+ });
+
+ message = message.replace(/&#62;&#62;\n([\s\S]*?)\n&#60;&#60;/g, function(whole,s1) {
+ return( '<pre>' + s1 + '</pre>' );
+ });
+
+ message = message.replace(/\n/g, "<br />");
+
+
+ message = message.replace(/#([a-zA-Z0-9]+)($| )/g, function(whole,s1) {
+ return( ' <span style="color:orange;font-weight:bold" onclick="addTag(\''+s1+'\')">#' + s1 + '</span> ' );
+ });
+
+ return message;
+
+}
View
8 public/js/main_android.js
@@ -9,7 +9,13 @@ hook.addHook('onUserMessage', function(hash){
});
hook.addHook('doScrollBottom', function(hash){
- $(window).scrollTop(10000000); //TODO
+ var nowBottom = $(window).height() + $(window).scrollTop();
+ var domHeight = $('html')[0].scrollHeight;
+ var lastElmHeight = $('#lines *.messagecell:last').height();
+
+ if( domHeight - lastElmHeight <= nowBottom + 10 ){ // 10は遊び
+ $(window).scrollTop(10000000);
+ }
});
View
75 public/js/main_pc.js
@@ -19,11 +19,14 @@ hook.addHook('onUserMessage', function(hash){
});
hook.addHook('doScrollBottom', function(hash){
- $('#lines').get(0).scrollTop = 10000000; //TODO
+ var nowBottom = $('#lines').height()+$('#lines').scrollTop();
+ var domHeight = $('#lines')[0].scrollHeight;
+ var lastElmHeight = $('#lines *.messagecell:last').height();
+ if( domHeight - lastElmHeight <= nowBottom + 10 ){ // 10は遊び
+ $('#lines').get(0).scrollTop = 10000000;
+ }
});
-
-
hook.addHook('onConnect', function(hash){
//Cookieがあれば、オートログインさせる
autologin();
@@ -35,13 +38,16 @@ function resizeMessageTextarea(linenum){
if($("#message").val().match(/\n/)){
linenum = $("#message").val().match(/\n/g).length + 1;
}else{
- linenum = 1;
+ linenum = 2;
}
}
+ if(linenum == 1){
+ linenum=2;
+ }
if(linenum>10){
linenum=10; // hard limit
}
-
+
var em = (linenum * 1.2) + 'em';
$("#message").css('height', em);
$(window).resize();
@@ -74,14 +80,14 @@ $(function () {
//各エレメントのサイズ計算
$(window).resize(function(){
-
var height = $(window).height() - $('#send-message').height();
$("#messages").css('height', height+'px');
$("#lines").css('height', height+'px');
$("#infomation").css('height', height+'px');
});
$(window).resize();
+ resizeMessageTextarea();
var loader = new PreloadJS(false);
loader.installPlugin(SoundJS);
@@ -94,6 +100,8 @@ $(function () {
$('abbr.timeago').timeago();
},60000);
+ initVirtualCheckbox('.virtualcheckbox');
+
//デスクトップ通知許可
if (jwNotify.status) {
if ( jwNotify.notifications.checkPermission() == 0 ) {
@@ -143,13 +151,26 @@ $(function () {
var soundMessage = function(){};//ロード前にエラーにならないように
function onSoundLoadComplete(){
soundMessage = function(){
- if($('#sound').prop("checked")){
+ if($('#sound').attr("checked")){
SoundJS.play('message', SoundJS.INTERRUPT_EARLY, 0, 0, false);
}
}
}
//引用選択機能
+function startOrEndSelectPost(e){
+ var elm = $(e.target);
+
+ if(elm.attr('checked')){
+ endSelectPost();
+ toggleVirtualCheckbox(e);
+ }else{
+ startSelectPost();
+ toggleVirtualCheckbox(e);
+ }
+}
+
+
function startSelectPost(){
$('.messagecell').on('click', function(){
if($(this).hasClass('selectedMessageCell')){
@@ -176,3 +197,43 @@ function endSelectPost(){
$('#popuper').attr('action', url).submit();
$('.messagecell').removeClass('selectedMessageCell')
}
+
+
+function initVirtualCheckbox(query){
+ $(query).each(function(){
+ var elm = $(this);
+ if(!elm.attr('data-onsrc') || !elm.attr('data-offsrc')){
+ var src = elm.attr('src');
+ elm.attr('data-offsrc', src);
+ elm.attr('data-onsrc', src.replace(/.(gif|jpeg|jpg|png)$/i, "_on.$1") );
+ }
+ if( $(elm).attr('checked') ){
+ $(elm).attr('src', $(elm).attr('data-onsrc'));
+ }else{
+ $(elm).attr('src', $(elm).attr('data-offsrc'));
+ }
+ });
+}
+
+function toggleVirtualCheckbox(e){
+ var elm = $(e.target);
+ if( elm.attr('checked') ){
+ elm.removeAttr('checked')
+ elm.attr('src', elm.attr('data-offsrc'));
+ }else{
+ elm.attr('checked', 'checked')
+ elm.attr('src', elm.attr('data-onsrc'));
+ }
+}
+
+function setVirtualCheckbox(elm, state){
+ var elm = $(elm);
+ if( state ){
+ elm.removeAttr('checked')
+ elm.attr('src', elm.attr('data-offsrc'));
+ }else{
+ elm.attr('checked', 'checked')
+ elm.attr('src', elm.attr('data-onsrc'));
+ }
+}
+
View
33 public/pc_hints.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+
+<pre>
+Shift+Enterで改行
+
+・コードハイライト
+
+>|javascript|
+CODE
+||<
+
+>|perl|
+CODE
+||<
+
+・PRE
+>>
+テキスト
+<<
+
+・画像ポスト
+<a href="http://yairc.cfe.jp:5000/">http://yairc.cfe.jp:5000/ </a>
+※Gyazo互換です
+
+
+</pre>
+
+</body>
+</html>
View
51 public/stylesheets/pc.css
@@ -3,6 +3,9 @@ padding:0px;
margin:0px;
}
+a{
+ color:#f25d06;
+}
#nickname, #connecting, #loading {
position: absolute;
@@ -47,6 +50,10 @@ margin:0px;
}
+.onclk{
+ cursor:pointer;
+}
+
#lines {
overflow: auto;
overflow-x: auto;
@@ -56,61 +63,51 @@ margin:0px;
}
#infomation{
- width:190px;
+ background-color: #bfd8e7;
+ width:295px;
float:right;
overflow-y:scroll;
}
#infomation #nicknames ,#infomation #tags {
- border-bottom:1px #999 solid;padding:3px;
font: 11px Helvetica;
}
#infomation #nicknames b{
display: inline-block;
- color: #fff;
- background: gray;
+ color: #000017;
padding: 3px 6px;
margin-right: 5px;
margin-bottom: 5px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
- text-shadow: 0 1px 0 #666;
}
+#infomation #tags{
+ padding:3px;
+
+}
#infomation #tags b.tagcell {
display: inline-block;
color: #fff;
- background: red;
+ background: #f25d07;
padding: 3px 6px;
margin-right: 5px;
margin-bottom: 5px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
- text-shadow: 0 1px 0 #666;
+}
+#infomation #tags b.tagcell a {
+ color: #CCC;
}
#infomation #tags b.disable_tag {
background: gray;
}
#send-message textarea {
- border: 1px solid gray;
- height: 1.2em;
- padding: 5 5px;
- line-height: 1.2em;
- vertical-align: middle;
- width: 100%;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
-
-}
-#send-message button {
- margin-top: 5px;
- margin-right: 5px;
+ border: none;
+ font-size:12px;
+ margin-top:2px;
+ margin-bottom:-2px;
+ padding:0px;
+ width:100%;
}
.messagecell_plusplus button {
View
2 t/201_build_endpoint.t
@@ -24,7 +24,7 @@ my $config = {
default_tag => 'PUBLIC',
introduction => 'テストサーバ',
auth_endpoint => {
- '/login' => [ 'Simple' => { name_field => 'nick' } => {} ],
+ '/login' => [ 'Yancha::Auth::Simple' => { name_field => 'nick' } => {} ],
}
},
};
View
2 t/303_basic_auth.t
@@ -30,7 +30,7 @@ my $config = {
introduction => 'テストサーバ',
auth_endpoint => {
'/login' => [
- 'BasicAuth' => {
+ 'Yancha::Auth::BasicAuth' => {
passwd_file => $file,
check_hashes => ['plain'],
realm => 'Hachioji.pm',
View
2 t/431_server_info.t
@@ -21,7 +21,7 @@ my $config = {
default_tag => 'PUBLIC',
introduction => 'テストサーバ',
auth_endpoint => {
- '/login' => [ 'Simple' => { name_field => 'nick' } => { description => "simpleなログインです" } ],
+ '/login' => [ 'Yancha::Auth::Simple' => { name_field => 'nick' } => { description => "simpleなログインです" } ],
}
},
};
View
2 t/501_norec.t
@@ -20,7 +20,7 @@ my $config = {
'server_info' => {
default_tag => 'PUBLIC',
auth_endpoint => {
- '/login' => [ 'Simple' => { name_field => 'nick' } => {} ],
+ '/login' => [ 'Yancha::Auth::Simple' => { name_field => 'nick' } => {} ],
}
},
View
2 t/800_add_post.t
@@ -21,7 +21,7 @@ my $config = {
database => {connect_info => [$mysqld->dsn]},
server_info => {
api_endpoint => {
- '/api/post' => ['Post', {}, 'For testing'],
+ '/api/post' => ['Yancha::API::Post', {}, 'For testing'],
}
},
};
View
2 t/Utils.pm
@@ -29,7 +29,7 @@ sub server_with_dbi {
my $api_endpoint_conf = ($config->{server_info} || {})->{api_endpoint};
my $auth_endpoint_conf = ($config->{server_info}->{ auth_endpoint } || {
- auth_endpoint => { '/login' => [ 'Simple', { name_field => 'nick' } ] },
+ auth_endpoint => { '/login' => [ 'Yancha::Auth::Simple', { name_field => 'nick' } ] },
})->{auth_endpoint};
$sys->build_psgi_endpoint_from_server_info('api', $api_endpoint_conf)

No commit comments for this range

Something went wrong with that request. Please try again.