Skip to content

Commit fb08e82

Browse files
committed
Merge pull request #52 from okjsp/v0.6
V0.6
2 parents d52f607 + 6c7be39 commit fb08e82

File tree

27 files changed

+253
-115
lines changed

27 files changed

+253
-115
lines changed

grails-app/assets/javascripts/application.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
//= require libs/mustache
1717
//= require libs/jquery.timeago
1818
//= require libs/jquery.timeago-ko-KR
19+
//= require apps/utils
1920
//= require_self
2021

2122

@@ -50,10 +51,14 @@ if (typeof jQuery !== 'undefined') {
5051
});
5152

5253
$('html, body').click(function(e) {
53-
if(!$(e.target).is('.sidebar-header *, .nav-main *, .sidebar-category-nav *')) {
54+
if(!$(e.target).is('.sidebar-header *, .nav-main *, .sidebar-category-nav *, #search-google-form *')) {
5455
$('.sidebar').removeClass('open');
5556
$('.sidebar-category-nav').removeClass('open');
5657
}
58+
59+
if(!$(e.target).is('#search-google *, #search-google-popover *')) {
60+
$('#search-google').popover('hide');
61+
}
5762
});
5863

5964
$.extend($.summernote.options, {toolbar : [

grails-app/assets/javascripts/apps/article.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//= require apps/note
33
//= require apps/vote
44
//= require apps/scrap
5-
//= require apps/utils
65
//= require_self
76

87
$(function() {

grails-app/assets/javascripts/apps/notification.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $(function() {
1616
var notificationsHtml = '';
1717

1818
$('#user-notification-count').hide();
19-
$('#user-func-icon').show();
19+
$('#user-notification-icon').show();
2020

2121
$(data.notifications).each(function(i, notification) {
2222
var senders = '', date, text = Mustache.render(notificationText[notification.type], notification);
@@ -67,11 +67,6 @@ $(function() {
6767
html: true
6868
});
6969

70-
function whereToPlacePopover(){
71-
if ($(window).width()<768) return 'bottom';
72-
return 'right';
73-
}
74-
7570
$(document).delegate('#notification-popover .notification-link', 'click' , function(e) {
7671
var data = $(this).data();
7772
location.href = contextPath+'/article/'+data.article+'?note='+data.content;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$(function() {
2+
3+
$('#search-google').on('shown.bs.popover', function () {
4+
$('#search-google-popover').find('input[name="qt"]').get(0).focus();
5+
});
6+
7+
$('#search-google').popover({
8+
container: 'body',
9+
title: 'Google 검색',
10+
placement: 'right',
11+
content: $('#search-google-form').clone().attr('id', 'search-google-popover')[0],
12+
html: true
13+
});
14+
15+
$('body').delegate('form[name="searchMain"]', 'submit', function() {
16+
var searchMain = $(this)[0];
17+
searchMain.q.value = 'site:okky.kr '+searchMain.qt.value;
18+
});
19+
});

grails-app/assets/javascripts/apps/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ var autoLinker = function(node) {
1313
if(!$(this).is('a, pre, code')) autoLinker(this);
1414
}
1515
});
16-
};
16+
};
17+
18+
var whereToPlacePopover = function(){
19+
if ($(window).width()<768) return 'bottom';
20+
return 'right';
21+
}

grails-app/assets/javascripts/libs/bootstrap-tagsinput.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@
357357
}
358358

359359
switch (event.which) {
360+
// Enter
361+
case 13:
362+
event.preventDefault();
363+
break;
360364
// BACKSPACE
361365
case 8:
362366
if (doGetCaretPosition($input[0]) === 0) {
@@ -409,12 +413,7 @@
409413
self.$container.on('keyup', 'input', $.proxy(function(event) {
410414
var $input = $(event.target);
411415

412-
if (self.$element.attr('disabled')) {
413-
self.$input.attr('disabled', 'disabled');
414-
return;
415-
}
416-
417-
var text = $input.val().substr(0, $input.val().length-1),
416+
var text = $input.val().substr(0, $input.val().length),
418417
maxLengthReached = self.options.maxChars && text.length >= self.options.maxChars;
419418
if (self.options.freeInput && (keyCombinationInList(event, self.options.confirmKeys) || maxLengthReached)) {
420419
self.add(maxLengthReached ? text.substr(0, self.options.maxChars) : text);

grails-app/assets/javascripts/libs/summernote.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,7 @@
35633563
style: function (lang, options) {
35643564
var items = options.styleTags.reduce(function (memo, v) {
35653565
var label = lang.style[v === 'p' ? 'normal' : v];
3566-
return memo + '<li><a data-event="formatBlock" href="#" data-value="' + v + '">' +
3566+
return memo + '<li><a data-event="formatBlock" href="javascript://" data-value="' + v + '">' +
35673567
(
35683568
(v === 'p' || v === 'pre') ? label :
35693569
'<' + v + '>' + label + '</' + v + '>'
@@ -3579,7 +3579,7 @@
35793579
fontname: function (lang, options) {
35803580
var items = options.fontNames.reduce(function (memo, v) {
35813581
if (!agent.isFontInstalled(v)) { return memo; }
3582-
return memo + '<li><a data-event="fontName" href="#" data-value="' + v + '">' +
3582+
return memo + '<li><a data-event="fontName" href="javascript://" data-value="' + v + '">' +
35833583
'<i class="fa fa-check icon-ok"></i> ' + v +
35843584
'</a></li>';
35853585
}, '');
@@ -3593,7 +3593,7 @@
35933593
},
35943594
fontsize: function (lang, options) {
35953595
var items = options.fontSizes.reduce(function (memo, v) {
3596-
return memo + '<li><a data-event="fontSize" href="#" data-value="' + v + '">' +
3596+
return memo + '<li><a data-event="fontSize" href="javascript://" data-value="' + v + '">' +
35973597
'<i class="fa fa-check icon-ok"></i> ' + v +
35983598
'</a></li>';
35993599
}, '');
@@ -3738,7 +3738,7 @@
37383738
},
37393739
height: function (lang, options) {
37403740
var items = options.lineHeights.reduce(function (memo, v) {
3741-
return memo + '<li><a data-event="lineHeight" href="#" data-value="' + parseFloat(v) + '">' +
3741+
return memo + '<li><a data-event="lineHeight" href="javascript://" data-value="' + parseFloat(v) + '">' +
37423742
'<i class="fa fa-check icon-ok"></i> ' + v +
37433743
'</a></li>';
37443744
}, '');
@@ -3974,7 +3974,7 @@
39743974
'<input class="note-image-input" type="file" name="files" accept="image/*" />' +
39753975
'<h5>' + lang.image.url + '</h5>' +
39763976
'<input class="note-image-url form-control span12" type="text" />';
3977-
var footer = '<button href="#" class="btn btn-primary note-image-btn disabled" disabled>' + lang.image.insert + '</button>';
3977+
var footer = '<button href="javascript://" class="btn btn-primary note-image-btn disabled" disabled>' + lang.image.insert + '</button>';
39783978
return tplDialog('note-image-dialog', lang.image.insert, body, footer);
39793979
};
39803980

@@ -3994,7 +3994,7 @@
39943994
'</label>' +
39953995
'</div>' : ''
39963996
);
3997-
var footer = '<button href="#" class="btn btn-primary note-link-btn disabled" disabled>' + lang.link.insert + '</button>';
3997+
var footer = '<button javascript://" class="btn btn-primary note-link-btn disabled" disabled>' + lang.link.insert + '</button>';
39983998
return tplDialog('note-link-dialog', lang.link.insert, body, footer);
39993999
};
40004000

@@ -4003,7 +4003,7 @@
40034003
'<label>' + lang.video.url + '</label>&nbsp;<small class="text-muted">' + lang.video.providers + '</small>' +
40044004
'<input class="note-video-url form-control span12" type="text" />' +
40054005
'</div>';
4006-
var footer = '<button href="#" class="btn btn-primary note-video-btn disabled" disabled>' + lang.video.insert + '</button>';
4006+
var footer = '<button href="javascript://" class="btn btn-primary note-video-btn disabled" disabled>' + lang.video.insert + '</button>';
40074007
return tplDialog('note-video-dialog', lang.video.insert, body, footer);
40084008
};
40094009

@@ -4039,7 +4039,7 @@
40394039
'<label><input type="checkbox" class="note-codeblock-numbers"> '+ lang.codeBlock.showLineNumbers +'</label>' +
40404040
'</div>' +
40414041
'';
4042-
var footer = '<button href="#" class="btn btn-primary note-codeblock-btn disabled" disabled>' + lang.codeBlock.insert + '</button>';
4042+
var footer = '<button href="javascript://" class="btn btn-primary note-codeblock-btn disabled" disabled>' + lang.codeBlock.insert + '</button>';
40434043
return tplDialog('note-codeblock-dialog', lang.codeBlock.insert, body, footer);
40444044
};
40454045

grails-app/assets/stylesheets/application.css

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,27 @@ pre code {
301301
text-align: center;
302302
}
303303

304+
#search-google-icon {
305+
display: none;
306+
}
307+
308+
.sidebar-category #search-google-icon {
309+
display: block;
310+
}
311+
312+
#search-google-form {
313+
display: block;
314+
}
315+
316+
.sidebar-category #search-google-form {
317+
display: none;
318+
}
319+
304320
.nav-sidebar-search {
305321
margin-bottom: 5px;
306322
}
307323

324+
308325
.sidebar-category-nav {
309326
display: block;
310327
position: fixed;
@@ -692,11 +709,15 @@ pre code {
692709
border-left: 1px solid #00519c;
693710
}
694711

695-
.popover-notification {
712+
.popover-fixed {
696713
position: fixed !important;
697714
max-width: 400px;
698715
}
699716

717+
#search-google-popover {
718+
padding: 0;
719+
}
720+
700721
#notification-popover {
701722
width: 350px;
702723
min-height: 200px;
@@ -897,6 +918,16 @@ pre code {
897918
color: #999;
898919
}
899920

921+
922+
.category-filter-wrapper {
923+
margin-top: 20px;
924+
925+
}
926+
927+
.category-filter-query {
928+
width: 50%;
929+
}
930+
900931
.list-sort {
901932
float: left;
902933
list-style: none;
@@ -917,6 +948,7 @@ pre code {
917948
.list-sort li > a.active {
918949
color: #555;
919950
font-weight: bold;
951+
text-decoration: underline;
920952
}
921953

922954
.list-filter-form {
@@ -1224,6 +1256,10 @@ pre code {
12241256
behavior: url(/css/PIE.htc);
12251257
}
12261258

1259+
.has-error .bootstrap-tagsinput {
1260+
border-color: #a94442;
1261+
}
1262+
12271263
.table td {
12281264
padding: 8px 15px !important;
12291265
}
@@ -1609,7 +1645,7 @@ pre code {
16091645
}
16101646

16111647
.sidebar.open {
1612-
height: 260px;
1648+
height: 350px;
16131649
}
16141650

16151651
.nav-main {
@@ -1691,11 +1727,13 @@ pre code {
16911727
width: 70px;
16921728
}
16931729

1694-
.sidebar-category .nav-main li {
1730+
.sidebar-category .nav-main li,
1731+
.sidebar-category .nav-bottom li{
16951732
text-align: left;
16961733
}
16971734

1698-
.sidebar-category .nav-main .nav-sidebar-label {
1735+
.sidebar-category .nav-main .nav-sidebar-label,
1736+
.sidebar-category .nav-bottom .nav-sidebar-label {
16991737
display: inline;
17001738
}
17011739

@@ -1710,9 +1748,8 @@ pre code {
17101748
padding: 10px;
17111749
}
17121750

1713-
.nav-sidebar-form,
1714-
.nav-sidebar-search-wrapper {
1715-
display: none;
1751+
.nav-sidebar-form{
1752+
padding: 10px;
17161753
}
17171754

17181755
.sidebar-category {
@@ -1730,10 +1767,10 @@ pre code {
17301767
.sidebar-category-nav {
17311768
display: none;
17321769
bottom: inherit;
1733-
top: 40px;
1770+
top: 85px;
17341771
left: 50%;
17351772
width: 50%;
1736-
height: 220px;
1773+
height: 265px;
17371774
z-index: 10001;
17381775
}
17391776

@@ -1758,11 +1795,26 @@ pre code {
17581795
.sub-title {
17591796
font-size: 20px;
17601797
}
1761-
1762-
.nav-bottom {
1798+
1799+
.nav-sidebar.nav-bottom {
1800+
margin: 10px 0 0 10px;
1801+
width: 50%;
1802+
float: left;
1803+
}
1804+
1805+
.sidebar-category .nav-bottom {
1806+
display: block;
1807+
border-left: 4px solid #9fb0c9;
1808+
}
1809+
1810+
.sidebar-category #search-google-icon {
17631811
display: none;
17641812
}
17651813

1814+
.sidebar-category #search-google-form {
1815+
display: block;
1816+
}
1817+
17661818
.sponsor-banner {
17671819
margin-top: 10px;
17681820
text-align: right;
@@ -1790,6 +1842,10 @@ pre code {
17901842
width: 100%;
17911843
}
17921844

1845+
.category-filter-query {
1846+
width: 100%;
1847+
}
1848+
17931849
.sub-banner {
17941850
width: 100%;
17951851
}

grails-app/conf/BootStrap.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class BootStrap {
4848
}
4949

5050
// 1 Level Category
51-
def questionsCategory = Category.get('questions') ?: new Category(code: 'questions', labelCode: 'questions.label', defaultLabel: 'Q&A', iconCssNames: 'fa fa-database', sortOrder: 0, writable: true, useNote: true, useOpinion: true, useEvaluate: true, useTag: true).save(flush: true)
51+
def questionsCategory = Category.get('questions') ?: new Category(code: 'questions', labelCode: 'questions.label', defaultLabel: 'Q&A', iconCssNames: 'fa fa-database', sortOrder: 0, writable: true, useNote: true, useOpinion: true, useEvaluate: true, useTag: true, requireTag: true).save(flush: true)
5252
def techCategory = Category.get('tech') ?: new Category(code: 'tech', labelCode: 'tech.label', defaultLabel: 'Tech', iconCssNames: 'fa fa-code', sortOrder: 1, writable: false, useNote: true, useOpinion: false, useEvaluate: false, useTag: true).save(flush: true)
5353
def communityCategory = Category.get('community') ?: new Category(code: 'community', labelCode: 'community.label', defaultLabel: '커뮤니티', iconCssNames: 'fa fa-comments', sortOrder: 2, writable: false, useNote: true, useOpinion: false, useEvaluate: false, useTag: false).save(flush: true)
5454
def columnsCategory = Category.get('columns') ?: new Category(code: 'columns', labelCode: 'columns.label', defaultLabel: '칼럼', iconCssNames: 'fa fa-quote-left', sortOrder: 3, writable: false, useNote: true, useOpinion: false, useEvaluate: false, useTag: true).save(flush: true)

grails-app/conf/InterceptUrlMapConfig.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ grails.plugin.springsecurity.interceptUrlMap = [
4242

4343
'/seq/*': ['permitAll'],
4444

45+
'/bbs': ['permitAll'],
46+
4547
'/intro/**': ['permitAll'],
4648

4749
'/_admin/**': ['ROLE_ADMIN']

0 commit comments

Comments
 (0)