PageSourceSearch

https://static.gesoten.com/js/comment.js?v=20260924_1739

js gesoten.com collected 2026-09-24 09:01:53 UTC 56,577 bytes, 1,030 lines download raw bytes

1if($('.more_comment_read a').length > 0) {
2    var class_list = $('.more_comment_read a').attr('class').split(' ');
3    var get_class_list = "";
4    //PIEファイルでIEだとクラスが追加されるため
5    $.each(class_list, function(l,m){
6        //class名にpieつくのははじく
7        if(m.match(/^pie/)){
8        } else{
9             get_class_list += ' '+m;
10        }
11    });
12    var type = get_class_list.split(' ').pop();
13    if(type == 'mypage' || type == 'comment') {
14        var comment_type = 'user';
15    } else {
16        var comment_type = type;
17    }
18
19
20    //もっと見る表示切替
21    if(type != 'mypage') {
22        var cursor = 0;
23        if (type == 'topic')
24            cursor = 1;
25        if (type == 'community')
26            cursor = 1;
27        if (type == 'comment')
28            cursor = 1;
29    } else {
30        //タブ切り替え対応
31        var cate = $('#timeline ul li').attr('id').substring(4);
32        var cursor_all = 0;
33        var cursor_friend = 0;
34        var cursor_your = 0;
35        var cursor_reply = 0;
36        $('#timeline_tab li a').click(function(){
37            cate = $(this).parent().attr('id').substring(4);
38            if(cate == "all_tweets" && cursor_all == 0
39            || cate == 'your_tweets' && cursor_your == 0
40            || cate != "all_tweets" && cate != 'your_tweets' && cursor_reply == 0){
41                getComments();
42            }
43        });
44    }
45}
46
47$('.more_comment_read a').on('click',function () {
48    $(".add_stamp_timeline_box").hide();
49    getComments();
50});
51function getComments(){
52        if (typeof aync == "undefined")
53            async = true;
54
55        //api接続先振り分け
56        if(type != 'mypage') {
57            var api = "/api/comments.json?id="+id+"&type="+type+"&cursor="+cursor;
58        }else {
59            //マイページタブ切り替え処理
60            if(cate == "all_tweets"){
61                var api = "/api/comments.json?type="+comment_type+"&cate="+cate+"&cursor="+cursor_all;
62            }else if(cate == 'your_tweets'){
63                var api = "/api/comments.json?type="+comment_type+"&cate="+cate+"&cursor="+cursor_your;
64            }else{
65                var api = "/api/comments.json?type="+comment_type+"&cate="+cate+"&cursor="+cursor_reply;
66            }
67        }
68
69        $.ajax({
70			type: "GET",
71            cache:false,
72            global: false,
73            async:async,
74			url: api,
75			success: function(data) {
76                if(type != 'mypage') {
77                    cursor = data.cursor;
78                    //もっと見る表示切替
79                    //if(cursor == data.total_page )   $('.more_comment_read').hide();
80                } else {
81                    if(cate == 'all_tweets') {
82                        cursor_all = data.cursor;
83                        if(cursor_all >= data.total_page )   $('#all_tweets .more_comment_read').hide();
84                    } else if(cate == 'your_tweets') {
85                        cursor_your = data.cursor;
86                        if(cursor_your >= data.total_page) $('#your_tweets .more_comment_read').hide();
87                    } else {
88                        cursor_reply = data.cursor;
89                        if(cursor_reply >= data.total_page)   $('#reply_tweets .more_comment_read').hide();
90                    }
91                    //もっと見る表示切替
92                }
93
94                var html= "";
95                var comment_user_profile = "";
96                var community_add = "";
97                var topic_add ="";
98                var res_div ="";
99                var login_div = "";
100                var post_img = "";
101                var res_post_img= "";
102                var community_game_add = "";
103                var community_file_add = "";
104                var hidden_type = "";
105                var res_name_add = "";
106                var island_div = "";
107                var com_delete = "";
108                var com_res_count = "";
109                var stamp_div = "";
110
111                ////////////////// マイページとプロフィール詳細のもっとみるアクション start /////////////////////
112                if(type == 'mypage' || type == 'profile') {
113
114                $.each(data.comments, function() {
115                    //改行あれば追加
116                    var txt = this.body;
117                    txt = txt.replace(/\r\n/g, '\n');
118                    txt = txt.replace(/\r/g, '\n');
119                    var line = txt.split('\n');
120                    var lines = '';
121                    for(var i = 0; i < line.length; i++) {
122                        if(i == (line.length - 1)) {
123                            lines += line[i];
124                        }else {
125                            lines += line[i] + '<br />';
126                        }
127                    }
128                    this.body = lines;
129
130                    //改行あれば追加
131                    if (this.title) {
132                        var txt = this.title;
133                        txt = txt.replace(/\r\n/g, '\n');
134                        txt = txt.replace(/\r/g, '\n');
135                        var line = txt.split('\n');
136                        var lines = '';
137                        for(var i = 0; i < line.length; i++) {
138                            if(i == (line.length - 1)) {
139                                lines += line[i];
140                            }else {
141                                lines += line[i] + '<br />';
142                            }
143                        }
144                        this.title = lines;
145                    }
146                    //コメントした人のプロフィールへのリンク先追加
147                    if (data.user == this.user_id && type != 'profile') {
148                        //プロフィール画面では削除ボタン出さない
149                        com_delete = '<li class="delete_option"><form><input class="delete_my_tweet" type="submit" value="このつぶやきを削除する" /><input type="hidden" name="comment_id" value="'+this.comment_id+'" /><input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'"></form></li>';
150                    } else {
151                        com_delete = "";
152                    }
153
154                    //コミュニティ画像追加
155                    if(this.community_file_path != "") {
156                            community_file_add = '<img src="'+this.community_file_path['s']+'" alt="">';
157                    }
158
159                    //コミュニティー追加/ゲーム名追加
160                    if (this.community_id) {
161                        if (this.app_id) {
162    						if (this.app_id != 55) {
163    	                        community_add += '<li class="game_name"><a href="/games/game/'+this.app_id+'">'+community_file_add+this.community_name+'</a></li>';
164    						}
165                        } else {
166                            community_add = '<li class="game_name"><a href="/community/detail/'+this.community_id+'">'+community_file_add+this.community_name+'</a></li>';
167                        }
168                    } else {
169                        community_add = "";
170                    }
171                    //トピック追加
172                    if (this.topic_id) {
173                        topic_add = '<li class="topic_name"><a href="/community/topic_detail/'+this.topic_id+'">'+this.topic_name+'</a></li>';
174                    } else {
175                        topic_add = "";
176                    }
177
178                    //コメントに画像追加してるとき
179                    if (this.file_path) {
180                        post_img = '<div class="timeline_contents_img"><a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a></div>';
181                    } else {
182                        post_img = "";
183                    }
184
185                    //コメント返信元のユーザーネーム出す
186    				if (this.res_comment_id && type != 'comment') {
187                        res_name_add = '<li class="reply_to"><a href="/comment/detail/'+this.res_comment_id+'">'+this.res_nickname+'</a></li>';
188                    } else {
189                        res_name_add = "";
190                    }
191
192                    //島チェック
193                    island_div ="";
194                    if (this.island_flag && (type == 'community' || type == 'to
194pic')){
195                        // 管理局アカウント以外
196                        if (!whitelist.in_array(this.user_id)) {
197                            island_div = '<li class="go_island_link"><a href="/profile/detail/'+this.user_id+'">å³¶</a></li>';
198                        }
199                    }
200
201                    if(this.res_count > 0) {
202                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント('+this.res_count+')</a>';
203                    } else {
204                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント</a>';
205                    }
206
207                    //フォームに必要なhidden追加
208                    switch(type) {
209                        case 'community':
210                            hidden_type = '<input type="hidden" name="type" value="community"><input type="hidden" name="community_id" value="'+this.community_id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
211                            break;
212                        case 'topic':
213                            hidden_type = '<input type="hidden" name="type" value="topic"><input type="hidden" name="community_id" value="'+this.community_id+'"><input type="hidden" name="topic_id" value="'+this.topic_id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
214                            break;
215                        case 'mypage':
216                            hidden_type = '<input type="hidden" name="type" value="user"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
217                            break;
218                        case 'comment':
219                            hidden_type = '<input type="hidden" name="type" value="detail_under"><input type="hidden" name="res_parent_comment_id" value="'+id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
220                    }
221
222                    //フォーム追加
223                    //if (data.login && type != 'profile') {
224                    if (data.login && (type == 'community' || type == 'topic' || type == 'comment')){// || type == 'mypage')) {
225                        login_div = '<div id="more_' + this.comment_id + '" class="your_reply clearfix">\
226                                        <form action="/comment/comment_post_'+comment_type+'/" method="POST" enctype="multipart/form-data" class="form_comment_post">\
227                                            <a class="user_img medium" href="/profile/detail/'+data.user+'"><img src="'+data.thumbnail['s']+'" alt="" /></a>\
228                                            <textarea id="comment" name="comment" placeholder="'+this.nickname+'さんにコメント"></textarea>\
229                                        <ul class="btn_group clearfix">\
230                                            <li class="add_img"><span>画像を追加</span></li>\
231                                            <li class="add_emoji"><span>絵文字を追加</span></li>\
232                                            <li><input class="btn_gray" type="button" value="キャンセル" /></li>\
233                                            <li><input class="btn_orange mini" type="submit" value="コメントする"></li>\
234                                        </ul>\
235                                        <div class="add_img_box">\
236                                            <input type="file" name="file">\
237                                        </div>\
238                                        <div class="add_emoji_box">\
239                                        </div>'+hidden_type+'<input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'">\
240                                        </form>\
241                        </div>';
242
243                    } else {
244                        login_div = '';
245                    }
246                    //返信を追加
247                    if (this.res_count != 0 && type != 'mypage' && this.res_data) {//
248                        //中身を空にしないと前のが残ってる
249                        res_div = '';
250                        $.each(this.res_data, function(){
251                            res_div += '<dl class="replies clearfix"><dt>';
252
253                            res_div += '<a class="user_img tiny" href=';
254                            if (data.user == this.user_id) {
255                                res_div += '"/mypage/"';
256                            } else {
257                                res_div += '"/profile/detail/'+this.user_id+'"';
258                            }
259                            res_div += '><img src="'+this.thumbnail['s']+'" alt="" />'+this.nickname+'</a>';
260
261                            //コメントに画像追加してるとき
262                            if (this.file_path) {
263                                res_post_img = '<a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a>';
264                            } else {
265                                res_post_img = "";
266                            }
267
268                            res_div += '</dt>\
269                                       <dd>\
270                                       <p class="clearfix">'+res_post_img+this.body+'</p>\
271                                       </dd>\
272                                       </dl>';
273                        });
274                    } else {
275                        res_div = '';
276                    }
277
278                    // アクティビティ判定
279                    if (this.badge_id || this.level || this.app_id) {
280                        var dl_class = 'timeline_activity';
281                        var comment_body = '\
282    						<ul class="timeline_contents">';
283                        if (this.badge_id && this.badge_data) {
284                            if (this.badge_data.hidden_flg != 0 && !data.accessor_badge_get_list[this.badge_id]) {
285                                comment_body += '\
286        							<li class="clearfix">\
287        					            <div class="timeline_contents_img">\
288        					            	<img src="'+img_domain+'/img/geso/badge/badge_on.png" alt="???????" />\
289        					            </div>\
290    	    							<div class="right_text">\
291    	    								<p>'+this.nickname+'さんが何か隠しバッジを手に入れたらしい!</p>\
292    	    								<span>隠しバッジ!獲得条件はヒミツ。</span>\
293    	    							</div>\
294        							</li>';
295                            } else {
296                                comment_body += '\
297        							<li class="clearfix">\
298        								<div class="timeline_contents_img">\
299        								    <a href="/achievement/detail/'+this.badge_id+'"><img src="'+img_domain+'/img/geso/badge/'+this.badge_data.image_s+'"></a>\
300        								</div>\
301    	    							<div class="right_text">\
302        								    <p>'+this.nickname+'さんが「'+this.badge_data.name+'」バッジを手に入れた!</p>\
303        								    <span>'+this.badge_data.detail+'</span>\
304    	    							</div>\
305    	    						</li>';
306                            }
307                        } else if (this.level && this.level_data) {
308                            comment_body += '\
309    							<li class="clearfix">\
310    								<div class="timeline_contents_img">\
311    								    <a href="/mypage/level/'+this.level+'"><img src="'+img_domain+'/img/geso/level/'+this.level_data.image_s+'"></a>\
312    								</div>\
313    								<div class="right_text">\
314    								    <p>'+this.nickname+'さんがレベル'+this.level+'「'+this.level_data.name+'」にレベルアップ!</p>\
315    								    <span>'+this.level_data.message+'</span>\
316    								</div>\
317    							</li>';
318                        } else if (this.app_id) {
319    						if (this.app_id != "60") {
320                            	comment_body += '\
321                                	<li class="clearfix has_co_appid">\
322    								<div class="timeline_contents_img">';
323    						} else {
324                            	comment_body += '\
325                                	<li class="clearfix">\
326    								<div class="timeline_contents_img">';
327    						}
328                            if (this.img_url) {
329                                comment_body += '\
330    								    <img src="'+this.img_url+'">';
331                            } else if(this.community_file_path != "") {
332    							if (this.app_id != 55) {
333    	                            comment_body += '\
334                                        <a href="/games/game/'+this.app_id+'">\
335                                        <img src="'+this.community_file_path['m']+'" alt="">\
336                                        </a>';
337    							}
338                            }
339                            comment_body += '\
340    								</div>\
341    							<div class="right_text">';
342                            if (this.title) {
343                                comment_body += '\
344    								<p class="has_co_appid_title">'+this.title+'</p>';
345                            }
346    						if (this.app_id == 8080) {
347                                comment_body += '\
348    						    		<span class="has_co_appid_text">'+$('<div>').html(this.body).text()+'</span>\
349    						    	</div>\
350    						    	</li>';
351                            } else {
352                                comment_body += '\
353    						    		<span class="has_co_appid_text">'+this.body+'</span>\
354    						    	</div>\
355    						    	</li>';
356                            }
357                        }
358    					comment_body +=	'</ul>';
359                    } else {
360                        var dl_class = 'timeline_tweet';
361                        var comment_body = '\
362                            <ul class="timeline_contents">\
363                            <li class="clearfix">\
364                                '+post_img+'\
365                            	<div class="right_text">'+this.body+'</div>\
366                            </li>\
367                        	</ul>';
368                    }
369
370
371                    var presents = "";
372                    if (this.is_friend || data.user==this.user_id
372) {
373                        var onclick = 'makeLinkPresentList('+this.user_id+',this.parentNode, '+this.comment_id+','+this.is_friend+');return false;'
374                        if (data.user==this.user_id) {
375                            onclick="";
376                        }
377                        var cnt = data.presents && data.presents[this.comment_id] ? data.presents[this.comment_id] : 0;
378                        presents = '<a href="'+(data.user==this.user_id?'/profile/kizuna':"#")+'" class="open_gift present_btn" onclick="'+onclick+'"><img src="'+img_domain+'/img/spacer.gif"><span class="gift_count">'+cnt+'</span></a>';
379                    }
380
381                    // スタンプ
382                    if(this.stamp_file_path) {
383                        stamp_div = '<div class="stamp_timeline">';
384                        if(this.stamp_app_id != 0) {
385                            stamp_div += '<a href="/games/game/'+this.stamp_app_id+'" target="_blank">';
386                        }
387                        stamp_div += '<img src="//img.gesoten.com/img/stamp/'+this.stamp_file_path+'" alt="'+this.stamp_group_name+'" title="'+this.stamp_group_name+'">';
388                        if(this.stamp_app_id != 0) {
389                            stamp_div += '</a>';
390                        }
391                        stamp_div += '</div>';
392                    }
393
394                    //htmlを追加してるところ
395                    html += '\
396                        <dl class="tweet_list clearfix '+dl_class+'">\
397                            <dt class="loaded posted_user_img"><a class="user_img medium" href="/profile/detail/'+this.user_id+'"><img src="'+this.thumbnail['m']+'" alt="" /></a></dt>\
398                            <dd class="posted_tweet">\
399                                <div class="each_tweet_header clearfix">\
400                                    <ul class="inner clearfix">\
401                                        <li class="user_name"><a href="/profile/detail/'+this.user_id+'">'+this.nickname+'</a></li>\
402                                        <li class="detail">\
403                                            <ul class="clearfix">'+res_name_add+'\
404                                                <li class="post_td">'+this.created_at+'</li>\
405                                                <li class="cmts_count">'+com_res_count+'\
406                                                </li>\
407                                            </ul>\
408                                        </li>\
409                                    </ul>\
410                                </div>\
411                                '+comment_body+'\
412                                '+stamp_div+'\
413                                <div class="each_tweet_footer">\
414                                    <ul class="clearfix">'+community_add+topic_add+com_delete+'</ul>\
415                                </div>\
416                                '+login_div+'\
417                                <div class="replies_list">'+res_div+'</div>\
418                                '+presents+'\
419                            </dd>\
420                        </dl>';
421
422                    //毎回中身を空にする
423                    comment_user_profile = "";
424                    community_add = "";
425                    topic_add ="";
426                    res_div ="";
427                    login_div = "";
428                    post_img = "";
429                    res_post_img= "";
430                    community_game_add = "";
431                    community_file_add = "";
432                    hidden_type = "";
433                    res_name_add = "";
434                    island_div = "";
435                    com_delete = "";
436                    com_res_count = "";
437                    dl_class = "";
438                    comment_body = "";
439                    stamp_div = "";
440                });
441
442                ////////////////// マイページとプロフィール詳細のもっとみるアクション end /////////////////////
443                } else if (type == 'community') {
444                ////////////////// コミュニティ詳細のもっとみるアクション start /////////////////////
445
446                $.each(data.comments, function() {
447                    //改行あれば追加
448                    var txt = this.body;
449                    txt = txt.replace(/\r\n/g, '\n');
450                    txt = txt.replace(/\r/g, '\n');
451                    var line = txt.split('\n');
452                    var lines = '';
453                    for(var i = 0; i < line.length; i++) {
454                        if(i == (line.length - 1)) {
455                            lines += line[i];
456                        }else {
457                            lines += line[i] + '<br />';
458                        }
459                    }
460                    this.body = lines;
461                    //コメントした人のプロフィールへのリンク先追加
462                    if (data.user == this.user_id && type != 'profile') {
463                        //プロフィール画面では削除ボタン出さない
464                        com_delete = '<li class="delete_option"> <form><input class="delete_my_tweet btn_light_gray" type="submit" value="このつぶやき削除する" /><input type="hidden" name="comment_id" value="'+this.comment_id+'" /><input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'"></form></li>';
465                    } else {
466                        com_delete = "";
467                    }
468
469                    //コミュニティ画像追加
470                    if(this.community_file_path != "") {
471                            community_file_add = '<img src="'+this.community_file_path['s']+'">'+this.community_name;
472                    } else {
473                            community_file_add = this.community_name;
474                    }
475
476                    //コミュニティー追加/ゲーム名追加
477                    if (this.community_id) {
478                        community_add = '<li class="game_name"><a href="/community/detail/'+this.community_id+'">'+community_file_add+'</a></li>';
479                    } else {
480                        community_add = "";
481                    }
482
483                    //コメントに画像追加してるとき
484                    if (this.file_path) {
485                        post_img = '<a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a>';
486                    } else {
487                        post_img = "";
488                    }
489
490
491                    island_div ="";
492                    var block_div = '';
493                    // 管理局アカウント以外
494                    if (!whitelist.in_array(this.user_id)) {
495                        //ベジモンチェック
496                        //島チェック(やってるユーザーはリンク出す)
497                        if (this.island_flag){
498                            island_div = '<li class="go_island_link"><a href="/profile/detail/'+this.user_id+'"><img src="'+img_domain+'/img/spacer.gif" alt="この人の島を見る" />島</a></span>';
499                        }
500
501                        // ブロック通報フォーム
502                        if (data.user && data.user != this.user_id) {
503                            block_div = '<a href="#show_block" id="trigger_block" data-id="'+this.user_id+'"><i class="fa fa-ban"></i></a><a href="#show_report" id="trigger_report" data-id="'+this.comment_id+'"><i class="fa fa-frown-o"></i></a>';
504                        }
505                    }
506
507                    if(this.res_count > 0) {
508                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント('+this.res_count+')</a>';
509                    } else {
510                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント</a>';
511                    }
512
513                    //フォームに必要なhidden追加
514                    hidden_type = '<input type="hidden" name="type" value="community"><input type="hidden" name="community_id" value="'+this.community_id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'"><input type="hidden" name="stamp_id" class="stamp_timeline_item_id">';
515
516                    //フォーム追加
517                    if (data.login && type != 'profile') {
518                        login_div = '<div id="more_' + this.comment_id + '" class="your_reply clearfix">\
519                                        <form action="/comment/comment_post_'+comment_type+'/" method="POST" enctype="multipart/form-data" class="form_comment_post">\
520                                            <a class="user_img medium" href="/profile/detail/'+data.user+'"><img src="'+data.thumbnail['s']+'" alt="ユーザー画像" /></a>\
521                                            <textarea class="input-xlarge" id="comment" name="comment" rows="1" placeholder="'+this.nickname+'さんにコメント"></textarea>\
522                                        <ul class="btn_group clearfix">\
523                                            <li class="add_img"><span>画像を追加</span></li>\
524                                            <li class="add_emoji"><span>絵文字を追加</span></li>\
525                                            <li class="add_stamp_timeline"><span>スタンプを追加</span><span class="stamp_timeline_selected_image" style="display:none;"><img width="26" height="26">選択中<i class="fa fa-times"></i></span></li>\
526                                            <li><input class="btn_gray" type="button" value="キャンセル" /></li>\
527                                            <li><input class="btn_orange" type="submit" value="返信する"></li>\
528                                        </ul>\
529                                        <div class="add_img_box">\
530                                            <input type="file" name="file">\
531                                        </div>\
532                                        <div class="add_emoji_box">\
533                                        </div>\
534                                        <div class="add_stamp_timeline_box">\
535                                            <div class="close">&times;</div>\
536                                            <div class="stamp_timeline_carouselwrap clearfix">\
537                                            <div class="stamp_timeline_carousel">\
538                                            <ul class="add_stamp_timeline_group">\
539                                            </ul>\
540                                            </div>\
541                                            <div class="stamp_timeline_prev hide"><span class="stamp_arrow"><i class="fa fa-chevron-left"></i></span></div><div class="stamp_timeline_next hide"><span class="stamp_arrow"><i class="fa fa-chevron-right"></i></span></div>\
542                                            </div>\
543                                            <p class="stamp_areaborder"></p>\
544                                            <ul class="add_stamp_timeline_item"></ul>\
545                                        </div>\
546                                        '+hidden_type+'<input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'">\
547                                        </form>\
548                        </div>';
549
550                    } else {
551                        login_div = "";
552                    }
553                    //返信を追加
554                    if (this.res_count != 0 && this.res_data) {
555                        //中身を空にしないと前のが残ってる
556                        res_div ="";
557                        $.each(this.res_data, function(){
558                            res_div += '<dl class="replies clearfix"><dt>';
559
560                                res_div += '<a class="user_img tiny" href="/profile/detail/'+this.user_id+'"><img src="'+this.thumbnail['s']+'" alt="ユーザー画像" />'+this.nickname+'</a>';
561
562                            //コメントに画像追加してるとき
563                            if (this.file_path) {
564                                res_post_img = '<a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a>';
565                            } else {
566                                res_post_img = "";
567                            }
568
569                            //コメントにスタンプ追加してるとき
570                            if (this.stamp_file_path) {
571                                res_stamp = '<div class="stamp_timeline">';
572                                if(this.stamp_app_id != 0) {
573                                    res_stamp += '<a href="/games/game/'+this.stamp_app_id+'" target="_blank">';
574                                }
575                                res_stamp += '<img src="//img.gesoten.com/img/stamp/'+this.stamp_file_path+'" alt="'+this.stamp_group_name+'" title="'+this.stamp_group_name+'">';
576                                if(this.stamp_app_id != 0) {
577                                    res_stamp += '</a>';
578                                }
579                                res_stamp += '</div>';
580                            } else {
581                                res_stamp = "";
582                            }
583
584                            res_div += '</dt>\
585                                       <dd>\
586                                       <p>'+res_post_img+this.body+res_stamp+'</p>\
587                                       </dd>\
588                                       </dl>';
589                        });
590                    } else {
591                        res_div = '<dl class="replies clearfix"></dl>';
592                    }
593
594                    var presents = "";
595                    if (this.is_friend || data.user==this.user_id
595) {
596                        var onclick = 'makeLinkPresentList('+this.user_id+',this.parentNode, '+this.comment_id+','+this.is_friend+');return false;'
597                        if (data.user==this.user_id) {
598                            onclick="";
599                        }
600                        var cnt = data.presents && data.presents[this.comment_id] ? data.presents[this.comment_id] : 0;
601                        presents = '<a href="'+(data.user==this.user_id?'/profile/':"#")+'" class="open_gift present_btn" onclick="'+onclick+'"><img src="'+img_domain+'/img/spacer.gif"><span class="gift_count">'+cnt+'</span></a>';
602                    }
603
604                    // スタンプ
605                    if(this.stamp_file_path) {
606                        stamp_div = '<div class="stamp_timeline">';
607                        if(this.stamp_app_id != 0) {
608                            stamp_div += '<a href="/games/game/'+this.stamp_app_id+'" target="_blank">';
609                        }
610                        stamp_div += '<img src="//img.gesoten.com/img/stamp/'+this.stamp_file_path+'" alt="'+this.stamp_group_name+'" title="'+this.stamp_group_name+'">';
611                        if(this.stamp_app_id != 0) {
612                            stamp_div += '</a>';
613                        }
614                        stamp_div += '</div>';
615                    }
616
617                    //htmlを追加してるところ
618                    html += '<dt class="loaded posted_user_img">\
619                                <a class="user_img medium" href="/profile/detail/'+this.user_id+'"><img src="'+this.thumbnail['m']+'" alt="ユーザー画像" /></a>\
620                                '+block_div+'\
621                            </dt>\
622                            <dd class="posted_tweet">\
623                            <div class="each_tweet_header clearfix">\
624                                <ul class="inner clearfix">\
625                                    <li class="user_name">\
626                                        <a href="/profile/detail/'+this.user_id+'" class="bbs_user_name user_id_'+this.user_id+'">'+this.nickname+'</a>\
627                                    </li>\
628                                     <li class="detail">\
629                                        <ul class="clearfix">\
630                                            <li class="post_td">'+this.created_at+'</li>\
631                                            <li class="cmts_count">'+com_res_count+'</li>\
632                                        </ul>\
633                                    </li>\
634                                </ul>\
635                            </div>\
636                            <p>'+post_img+'<span id="comment_body_'+this.comment_id+'">'+this.body+'</span>'+stamp_div+'</p>\
637                            <div class="each_tweet_footer">\
638                                <ul class="clearfix">\
639                                '+island_div+community_add+com_delete+'\
640                                </ul>\
641                            </div>\
642                            '+login_div+'\
643                            <div class="replies_list">\
644                            '+res_div+'\
645                            </div>\
646                            '+presents+'\
647                        </dd>';
648
649                    //毎回中身を空にする
650                    comment_user_profile = "";
651                    community_add = "";
652                    topic_add ="";
653                    res_div ="";
654                    login_div = "";
655                    post_img = "";
656                    res_post_img= "";
657                    community_game_add = "";
658                    community_file_add = "";
659                    hidden_type = "";
660                    res_name_add = "";
661                    island_div = "";
662                    com_delete = "";
663                    com_res_count = "";
664                    stamp_div = "";
665                });
666                ////////////////// コミュニティ詳細のもっとみるアクション end /////////////////////
667                } else {
668                ////////////////// トピック詳細のもっとみるアクション start /////////////////////
669
670                $.each(data.comments, function() {
671                    //改行あれば追加
672                    var txt = this.body;
673                    txt = txt.replace(/\r\n/g, '\n');
674                    txt = txt.replace(/\r/g, '\n');
675                    var line = txt.split('\n');
676                    var lines = '';
677                    for(var i = 0; i < line.length; i++) {
678                        if(i == (line.length - 1)) {
679                            lines += line[i];
680                        }else {
681                            lines += line[i] + '<br />';
682                        }
683                    }
684                    this.body = lines;
685                    //コメントした人のプロフィールへのリンク先追加
686                    if (data.user == this.user_id && type != 'profile') {
687                        //プロフィール画面では削除ボタン出さない
688                        com_delete = '<form><input class="delete_my_tweet btn_light_gray" type="submit" value="このつぶやき削除する" /><input type="hidden" name="comment_id" value="'+this.comment_id+'" /><input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'"></form>';
689                    } else {
690                        com_delete = "";
691                    }
692
693                    //コミュニティ画像追加
694                    if(this.community_file_path != "") {
695                            community_file_add = '<img src="'+this.community_file_path['s']+'" alt="ゲームアイコン"><a href="/community/detail/'+this.community_id+'">'+this.community_name+'</a>';
696                    } else {
697                            community_file_add = '<a href="/community/detail/'+this.community_id+'">'+this.community_name+'</a>';
698                    }
699
700                    //コミュニティー追加/ゲーム名追加
701                    if (this.community_id) {
702                        community_add = '<li class="game_name"><a href="/community/detail/'+this.community_id+'">'+community_file_add+'</a></li>';
703                    } else {
704                        community_add = "";
705                    }
706                    //トピック追加
707                    if (this.topic_id) {
708                        topic_add = '<li><a href="/community/topic_detail/'+this.topic_id+'">'+this.topic_name+'</a></li>';
709                    } else {
710                        topic_add = "";
711                    }
712
713                    //コメントに画像追加してるとき
714                    if (this.file_path) {
715                        post_img = '<a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a>';
716                    } else {
717                        post_img = "";
718                    }
719
720                    //コメント返信元のユーザーネーム出す
721    				if (this.res_comment_id && type != 'comment') {
722                        res_name_add = '<li class="reply_to"><a href="/comment/detail/'+this.res_comment_id+'">'+this.res_nickname+'</a></li>';
723                    } else {
724                        res_name_add = "";
725                    }
726
727                    island_div ="";
728                    var block_div = '';
729                    // 管理局アカウント以外
730                    if (!whitelist.in_array(this.user_id)) {
731                        //島チェック(やってるユーザーはリンク出す)
732                        if (this.island_flag && (type == 'community' || type == 'topic')){
733                            island_div = '<span class="go_island_link"><a href="/profile/detail/'+this.user_id+'"><img src="'+img_domain+'/img/spacer.gif" alt="この人の島を見る" />島</a></span>';
734                        }
735
736                        // ブロック通報フォーム
737                        if (data.user && data.user != this.user_id
737) {
738                            block_div = '<a href="#show_block" id="trigger_block" data-id="'+this.user_id+'"><i class="fa fa-ban"></i></a><a href="#show_report" id="trigger_report" data-id="'+this.comment_id+'"><i class="fa fa-frown-o"></i></a>';
739                        }
740                    }
741
742                    if(this.res_count > 0) {
743                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント('+this.res_count+')</a>';
744                    } else {
745                        com_res_count = '<a href="/comment/detail/'+this.comment_id+'">コメント</a>';
746                    }
747
748                    //フォームに必要なhidden追加
749                    switch(type) {
750                        case 'community':
751                            hidden_type = '<input type="hidden" name="type" value="community"><input type="hidden" name="community_id" value="'+this.community_id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
752                            break;
753                        case 'topic':
754                            hidden_type = '<input type="hidden" name="type" value="topic"><input type="hidden" name="community_id" value="'+this.community_id+'"><input type="hidden" name="topic_id" value="'+this.topic_id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'"><input type="hidden" name="stamp_id" class="stamp_timeline_item_id">';
755                            break;
756                        case 'mypage':
757                            hidden_type = '<input type="hidden" name="type" value="user"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'">';
758                            break;
759                        case 'comment':
760                            hidden_type = '<input type="hidden" name="type" value="detail_under"><input type="hidden" name="res_parent_comment_id" value="'+id+'"><input type="hidden" name="res_comment_id" value="'+this.comment_id+'"><input type="hidden" name="stamp_id" class="stamp_timeline_item_id">';
761                    }
762
763                    //フォーム追加
764                    if (data.login && type != 'profile') {
765                        login_div = '<div id="more_' + this.comment_id + '" class="your_reply clearfix">\
766                                        <form action="/comment/comment_post_'+comment_type+'/" method="POST" enctype="multipart/form-data" class="form_comment_post">\
767                                            <a class="user_img medium" href="/profile/detail/'+data.user+'"><img src="'+data.thumbnail['s']+'" alt="ユーザー画像" /></a>\
768                                            <textarea id="comment" name="comment" placeholder="'+this.nickname+'さんにコメント"></textarea>\
769                                        <ul class="btn_group clearfix">\
770                                            <li class="add_img"><span>画像を追加</span></li>\
771                                            <li class="add_emoji"><span>絵文字を追加</span></li>\
772                                            <li class="add_stamp_timeline"><span>スタンプを追加</span><span class="stamp_timeline_selected_image" style="display:none;"><img width="26" height="26">選択中<i class="fa fa-times"></i></span></li>\
773                                            <li><input class="btn_gray" type="button" value="キャンセル" /></li>\
774                                            <li><input class="btn_orange" type="submit" value="返信する"></li>\
775                                        </ul>\
776                                        <div class="add_img_box">\
777                                            <input type="file" name="file">\
778                                        </div>\
779                                        <div class="add_emoji_box">\
780                                        </div>\
781                                        <div class="add_stamp_timeline_box">\
782                                            <div class="close">&times;</div>\
783                                            <div class="stamp_timeline_carouselwrap clearfix">\
784                                            <div class="stamp_timeline_carousel">\
785                                            <ul class="add_stamp_timeline_group">\
786                                            </ul>\
787                                            </div>\
788                                            <div class="stamp_timeline_prev hide"><span class="stamp_arrow"><i class="fa fa-chevron-left"></i></span></div><div class="stamp_timeline_next hide"><span class="stamp_arrow"><i class="fa fa-chevron-right"></i></span></div>\
789                                            </div>\
790                                            <p class="stamp_areaborder"></p>\
791                                            <ul class="add_stamp_timeline_item"></ul>\
792                                        </div>\
793                                        '+hidden_type+'<input type="hidden" name="fuel_csrf_token" value="'+fuel_csrf_token()+'">\
794                                        </form>\
795                        </div>';
796
797                    } else {
798                        login_div = "";
799                    }
800                    //返信を追加
801                    if (this.res_count != 0 && this.res_data) {
802                        //中身を空にしないと前のが残ってる
803                        res_div ="";
804                        $.each(this.res_data, function(){
805                            res_div += '<dl class="replies clearfix"><dt>';
806
807                                res_div += '<a class="user_img tiny" href="/profile/detail/'+this.user_id+'"><img src="'+this.thumbnail['s']+'" alt="ユーザー画像" />'+this.nickname+'</a>';
808
809                            //コメントに画像追加してるとき
810                            if (this.file_path) {
811                                res_post_img = '<a class="show_large" href="'+this.file_path['l']+'"><img src="'+this.file_path['s']+'"></a>';
812                            } else {
813                                res_post_img = "";
814                            }
815
816                            //コメントにスタンプ追加してるとき
817                            if (this.stamp_file_path) {
818                                res_stamp = '<div class="stamp_timeline">';
819                                if(this.stamp_app_id != 0) {
820                                    res_stamp += '<a href="/games/game/'+this.stamp_app_id+'" target="_blank">';
821                                }
822                                res_stamp += '<img src="//img.gesoten.com/img/stamp/'+this.stamp_file_path+'" alt="'+this.stamp_group_name+'" title="'+this.stamp_group_name+'">';
823                                if(this.stamp_app_id != 0) {
824                                    res_stamp += '</a>';
825                                }
826                                res_stamp += '</div>';
827                            } else {
828                                res_stamp = "";
829                            }
830
831                            res_div += '</dt>\
832                                       <dd>\
833                                       <p>'+res_post_img+this.body+res_stamp+'</p>\
834                                       </dd>\
835                                       </dl>';
836                        });
837                    } else {
838                        res_div = '<dl class="replies clearfix"></dl>';
839                    }
840
841                    var presents = "";
842                    if (this.is_friend || data.user==this.user_id
842) {
843                        var onclick = 'makeLinkPresentList('+this.user_id+',this.parentNode, '+this.comment_id+','+this.is_friend+');return false;'
844                        if (data.user==this.user_id) {
845                            onclick="";
846                        }
847                        var cnt = data.presents && data.presents[this.comment_id] ? data.presents[this.comment_id] : 0;
848                        presents = '<a href="'+(data.user==this.user_id?'/profile/kizuna':"#")+'" class="open_gift present_btn" onclick="'+onclick+'"><img src="'+img_domain+'/img/spacer.gif"><span class="gift_count">'+cnt+'</span></a>';
849                    }
850
851                    // スタンプ
852                    if(this.stamp_file_path) {
853                        stamp_div = '<div class="stamp_timeline">';
854                        if(this.stamp_app_id != 0) {
855                            stamp_div += '<a href="/games/game/'+this.stamp_app_id+'" target="_blank">';
856                        }
857                        stamp_div += '<img src="//img.gesoten.com/img/stamp/'+this.stamp_file_path+'" alt="'+this.stamp_group_name+'" title="'+this.stamp_group_name+'">';
858                        if(this.stamp_app_id != 0) {
859                            stamp_div += '</a>';
860                        }
861                        stamp_div += '</div>';
862                    }
863
864                    //htmlを追加してるところ
865                    html += '<dt class="loaded posted_user_img">\
866                                <a class="user_img medium" href="/profile/detail/'+this.user_id+'"><img src="'+this.thumbnail['m']+'" alt="ユーザー画像" /></a>\
867                                '+block_div+'\
868                            </dt>\
869                            <dd class="posted_tweet">\
870                                <span class="post_td">'+this.created_at+'</span>\
871                                <a href="/profile/detail/'+this.user_id+'" class="bbs_user_name user_id_'+this.user_id+'">'+this.nickname+'</a>\
872                                '+island_div+'\
873                                <div class="posted_tweet_body clearfix"><span id="comment_body_'+this.comment_id+'">'+this.body+'</span>'+stamp_div+post_img+com_delete+'</div>\
874                                '+login_div+'\
875                                <div class="replies_list">'+res_div+'</div>\
876                                '+presents+'\
877                            </dd>';
878
879                    //毎回中身を空にする
880                    comment_user_profile = "";
881                    community_add = "";
882                    topic_add ="";
883                    res_div ="";
884                    login_div = "";
885                    post_img = "";
886                    res_post_img= "";
887                    community_game_add = "";
888                    community_file_add = "";
889                    hidden_type = "";
890                    res_name_add = "";
891                    island_div = "";
892                    com_delete = "";
893                    com_res_count = "";
894                    stamp_div = "";
895                });
896                ////////////////// トピック詳細のもっとみるアクション end /////////////////////
897                }
898
899                if(type == 'mypage') {
900                    $('#'+cate+' .timeline_append_span').append(html);
901                } else if(type == 'profile') {
902                    $('.timeline_append_span').append(html);
903                } else {
904                    $('.tweet_list').append(html);
905                    Comment.Action.SetStamp();
906                }
907                $(".loaded").next().find("textarea").charCount();
908                //hover時にtitle属性をツールチップ化
909                $(".stamp_timeline img").tipTip({
910                    delay: 100,
911                    defaultPosition: "bottom"
912                });
913            },
914            error: function(XMLHttpRequest, textStatus, errorThrown) {
915                this;
916                //alert('Error:' + errorThrown);
917            }
918        });
919
920};
921
922
923//コメント削除ボタンクリック
924$(document).on("click", ".delete_my_tweet", function(){
925    var is_parent = $(this).next().next().next().val();
926    var data = {comment_id : $(this).next().val(),fuel_csrf_token : $(this).next().next().val()};
927    //コメント欄空の時は送れないように
928    if(data.comment_id == null) return false;
929    $.ajax({
930        type:'POST',
931        url:'/api/delete_comments',
932        data: data,
933        success: function(data, dataType) {
934            if (is_parent) {
935                location.href = "/mypage";
936            } else {
937                document.location.reload(true);
938            }
939        },
940        error: function(XMLHttpRequest, textStatus, errorThrown) {
941            this;
942            //alert('Error:' + errorThrown);
943        }
944    });
945    $('form').submit(function(){
946        return false;
947    });
948});
949
950//コメント既読にする
951$("#show_cmts a").click(function(){
952    var count = $('#show_cmts a strong').text();
953    if(count != 0)  read_status();
954});
955
956$("#tab_reply_tweets").click(function(){
957    var count = $('#tab_reply_tweets a strong').text();
958    if(count != 0)  read_status();
959});
960
961//コメント既読clickイベントに引数複数指定の仕方がわからない
962function read_status() {
963    $.ajax({
964        type:'POST',
965        url:'/api/read_status',
966        data: null,
967        success: function(data, dataType) {
968           //$('#show_cmts a strong').text('0');
969           $('#tab_reply_tweets a strong').remove();
970        },
971        error: function(XMLHttpRequest, textStatus, errorThrown) {
972            this;
973            //alert('Error:' + errorThrown);
974        }
975    });
976}
977
978$(function(){
979    $('#activity_btn').click(function() {
980        if ($("#ActivitySetting").css("display") == "block") {
981            $("#ActivitySetting").hide();
982        } else {
983            $("#ActivitySetting").show();
984        }
985        return false;
986    });
987});
988
989$(function(){
990    $('#activity_form').submit(function() {
991        var activity_user = [];
992        var activity_app = [];
993        $("[name='activity_user[]']:checked").each(function(){
994            activity_user.push(this.value);
995        });
996        $("[name='activity_app[]']:checked").each(function(){
997            activity_app.push(this.value);
998        });
999        $.ajax({
1000            type:'POST',
1001            url:'/api/comment_activity',
1002            data: {
1003                'activity_user':activity_user,
1004                'activity_app':activity_app
1005            },
1006            success: function(data, dataType) {
1007                $('#ActivitySetting').hide();
1008                if(data.status == 'success') {
1009                    alert("設定を変更しました。\n反映されるまで時間がかかることがあります。");
1010                } else {
1011                    var code = data.code;
1012                    alert("エラーが発生しました。\n再度時間をあけて設定してください。\nエラーコード : "+code);
1013                }
1014            },
1015            error: function(XMLHttpRequest, textStatus, errorThrown) {
1016                this;
1017            }
1018        });
1019        return false;
1020    });
1021
1022    $('.form_comment_post').on('submit', function(event) {
1023        var comment = $(this).find('*[name=comment]').val();
1024        var stamp_id = $(this).find('*[name=stamp_id]').val();
1025        if (!comment && !stamp_id) {
1026            event.preventDefault();
1027            return false;
1028        }
1029    });
1030});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.