Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
7024ba85
Commit
7024ba85
authored
Dec 11, 2013
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
編集ページのjsの不具合解消
parent
c44e6e14
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
app/assets/javascripts/application.js
+1
-1
app/assets/javascripts/lib/debug.js.coffee
+6
-0
app/assets/javascripts/posts/edit.js.coffee
+4
-2
app/models/post.rb
+1
-1
No files found.
app/assets/javascripts/application.js
View file @
7024ba85
...
...
@@ -10,10 +10,10 @@
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_self
// require jquery
// require jquery_ujs
// require turbolinks
//= require_tree ./lib
//= require_tree .
//= require_self
app/assets/javascripts/lib/debug.js.coffee
0 → 100644
View file @
7024ba85
window
.
debug
=
->
if
console
?
&&
console
.
debug
?
&&
location
.
hash
is
'#debug'
return
console
.
log
.
bind
(
console
)
else
->
app/assets/javascripts/posts/edit.js.coffee
View file @
7024ba85
if
window
.
location
.
pathname
.
match
/edit/
if
window
.
location
.
pathname
.
match
/edit
|new
/
$
->
...
...
@@ -17,6 +17,7 @@ if window.location.pathname.match /edit/
$this
=
$
(
this
)
keyCode
=
e
.
keyCode
||
e
.
which
# tab key
if
keyCode
is
9
e
.
preventDefault
()
start
=
$this
.
get
(
0
).
selectionStart
...
...
@@ -31,13 +32,14 @@ if window.location.pathname.match /edit/
$this
.
get
(
0
).
selectionStart
=
$this
.
get
(
0
).
selectionEnd
=
start
+
1
# enter key
else
if
keyCode
is
13
val
=
$this
.
val
()
start
=
$this
.
get
(
0
).
selectionStart
bl
=
val
.
lastIndexOf
(
"
\n
"
,
start
-
1
)
line
=
val
.
substring
(
bl
,
start
)
lm
=
line
.
match
(
/^\s+/
)
ns
=
lm
?
lm
[
0
].
length
-
1
:
0
ns
=
if
lm
?
then
lm
[
0
].
length
-
1
else
0
nv
=
val
.
substring
(
0
,
start
)
+
"
\n
"
_
(
ns
).
times
->
nv
+=
"
\t
"
...
...
app/models/post.rb
View file @
7024ba85
...
...
@@ -29,7 +29,7 @@ class Post < ActiveRecord::Base
_date
=
Time
.
new
(
$1
,
$2
,
$3
)
_where_list
=
_where_list
.
where
(
'updated_at > ? AND updated_at < ?'
,
_date
,
_date
+
1
.
day
)
else
_where_list
=
_where_list
.
where
(
'
body
LIKE ? OR body LIKE ?'
,
"%
#{
_query
}
%"
,
"%
#{
_query
}
%"
)
_where_list
=
_where_list
.
where
(
'
title
LIKE ? OR body LIKE ?'
,
"%
#{
_query
}
%"
,
"%
#{
_query
}
%"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment