forked from jenders/ice_kickstarter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'edit_date_field' of github.com:cedrics/infopark_kicksta…
…rter into cedrics-edit_date_field # By Cedric Sohrauer # Via Cedric Sohrauer * 'edit_date_field' of github.com:cedrics/infopark_kickstarter: Add inline editing for date Conflicts: lib/generators/cms/kickstart/templates/app/assets/javascripts/editing.js tmp/test_app/app/assets/javascripts/editing.js
- Loading branch information
Showing
13 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/generators/cms/kickstart/templates/app/assets/javascripts/editing.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
jQuery -> | ||
infopark.on 'new_content', -> | ||
cmsEditEnums = $('[data-ip-field-type=enum], [data-ip-field-type=multienum]') | ||
|
||
for cmsEditEnum in cmsEditEnums | ||
$(cmsEditEnum).on 'focusout', -> | ||
cmsEditEnum.infopark('save', $(cmsEditEnum).val()) | ||
|
||
|
||
cmsEditDates = $('[data-ip-field-type=date]') | ||
|
||
for cmsEditDate in cmsEditDates | ||
dateField = $(cmsEditDate).find('input[type=text]') | ||
|
||
$(dateField).datepicker(format: 'yyyy-mm-dd').on 'hide', (event) -> | ||
date = event.date | ||
|
||
# Set date hour to 12 to work around complex time zone handling. | ||
date.setHours(12) | ||
|
||
$(cmsEditDate).infopark('save', date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
jQuery -> | ||
infopark.on 'new_content', -> | ||
cmsEditEnums = $('[data-ip-field-type=enum], [data-ip-field-type=multienum]') | ||
|
||
for cmsEditEnum in cmsEditEnums | ||
$(cmsEditEnum).on 'focusout', -> | ||
cmsEditEnum.infopark('save', $(cmsEditEnum).val()) | ||
|
||
|
||
cmsEditDates = $('[data-ip-field-type=date]') | ||
|
||
for cmsEditDate in cmsEditDates | ||
dateField = $(cmsEditDate).find('input[type=text]') | ||
|
||
$(dateField).datepicker(format: 'yyyy-mm-dd').on 'hide', (event) -> | ||
date = event.date | ||
|
||
# Set date hour to 12 to work around complex time zone handling. | ||
date.setHours(12) | ||
|
||
$(cmsEditDate).infopark('save', date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters