Compare commits
2 Commits
61850ff461
...
e2ab04b95c
Author | SHA1 | Date |
---|---|---|
|
e2ab04b95c | |
|
6f2e378030 |
|
@ -136,6 +136,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#view_holder {
|
#view_holder {
|
||||||
|
position: relative;
|
||||||
|
z-index: 0; //z-index can be set when position other than static.
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,9 +699,12 @@
|
||||||
& > .modal-content {
|
& > .modal-content {
|
||||||
h3 {
|
h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
& > .modal-body {
|
||||||
|
white-space: pre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.event_summary {
|
.event_summary {
|
||||||
margin-right: -15px;
|
margin-right: -15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
@ -755,4 +760,10 @@
|
||||||
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
||||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.fc-event-title{
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
div[contentEditable=true]{
|
||||||
|
white-space: pre;
|
||||||
}
|
}
|
|
@ -479,6 +479,7 @@ a.fc-event:hover {
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
.fc-event .fc-event-main {
|
.fc-event .fc-event-main {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
/* dragging */
|
/* dragging */
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
@ -707,7 +708,7 @@ A HORIZONTAL event
|
||||||
display: table; }
|
display: table; }
|
||||||
.fc .fc-daygrid-body { /* a <div> that wraps the table */
|
.fc .fc-daygrid-body { /* a <div> that wraps the table */
|
||||||
position: relative;
|
position: relative;
|
||||||
/* container inner z-index's because <tr>s can't do it */
|
z-index: 1; /* container inner z-index's because <tr>s can't do it */
|
||||||
}
|
}
|
||||||
.fc .fc-daygrid-day.fc-day-today {
|
.fc .fc-daygrid-day.fc-day-today {
|
||||||
background-color: rgba(255, 220, 40, 0.15);
|
background-color: rgba(255, 220, 40, 0.15);
|
||||||
|
@ -736,6 +737,7 @@ A HORIZONTAL event
|
||||||
}
|
}
|
||||||
.fc .fc-daygrid-day-number {
|
.fc .fc-daygrid-day-number {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.fc {
|
.fc {
|
||||||
|
@ -798,9 +800,11 @@ A HORIZONTAL event
|
||||||
|
|
||||||
}
|
}
|
||||||
.fc .fc-daygrid-event {
|
.fc .fc-daygrid-event {
|
||||||
|
z-index: 6;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
}
|
}
|
||||||
.fc .fc-daygrid-event.fc-event-mirror {
|
.fc .fc-daygrid-event.fc-event-mirror {
|
||||||
|
z-index: 7;
|
||||||
}
|
}
|
||||||
.fc {
|
.fc {
|
||||||
|
|
||||||
|
@ -817,6 +821,7 @@ A HORIZONTAL event
|
||||||
display: table; }
|
display: table; }
|
||||||
.fc .fc-daygrid-more-link {
|
.fc .fc-daygrid-more-link {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.fc {
|
.fc {
|
||||||
|
@ -826,6 +831,7 @@ A HORIZONTAL event
|
||||||
}
|
}
|
||||||
.fc .fc-daygrid-week-number {
|
.fc .fc-daygrid-week-number {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 5;
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
min-width: 1.5em;
|
min-width: 1.5em;
|
||||||
|
@ -1042,14 +1048,14 @@ A VERTICAL event
|
||||||
bottom: calc(var(--fc-event-resizer-dot-total-width, 8px) / -2);
|
bottom: calc(var(--fc-event-resizer-dot-total-width, 8px) / -2);
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid .fc-daygrid-body { /* the all-day daygrid within the timegrid view */
|
.fc .fc-timegrid .fc-daygrid-body { /* the all-day daygrid within the timegrid view */
|
||||||
/* put above the timegrid-body so that more-popover is above everything. TODO: better solution */
|
z-index: 2; /* put above the timegrid-body so that more-popover is above everything. TODO: better solution */
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid-divider {
|
.fc .fc-timegrid-divider {
|
||||||
padding: 0 0 2px; /* browsers get confused when you set height. use padding instead */
|
padding: 0 0 2px; /* browsers get confused when you set height. use padding instead */
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid-body {
|
.fc .fc-timegrid-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
/* scope the z-indexes of slots and cols */
|
z-index: 1; /* scope the z-indexes of slots and cols */
|
||||||
min-height: 100%; /* fill height always, even when slat table doesn't grow */
|
min-height: 100%; /* fill height always, even when slat table doesn't grow */
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid-axis-chunk { /* for advanced ScrollGrid */
|
.fc .fc-timegrid-axis-chunk { /* for advanced ScrollGrid */
|
||||||
|
@ -1062,6 +1068,7 @@ A VERTICAL event
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid-slots {
|
.fc .fc-timegrid-slots {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
.fc .fc-timegrid-slot { /* a <td> */
|
.fc .fc-timegrid-slot { /* a <td> */
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
|
|
|
@ -356,4 +356,52 @@ class Event
|
||||||
recurring = recurring.concat(events)
|
recurring = recurring.concat(events)
|
||||||
recurring
|
recurring
|
||||||
end
|
end
|
||||||
|
def self.convertToText(str)
|
||||||
|
# Ensure string.
|
||||||
|
value = str.to_s
|
||||||
|
|
||||||
|
# Convert encoding.
|
||||||
|
value = value.gsub(/ /i, ' ')
|
||||||
|
value = value.gsub(/&/i, '&')
|
||||||
|
|
||||||
|
# Replace `<br>`.
|
||||||
|
value = value.gsub(/<br>/i, "\n")
|
||||||
|
|
||||||
|
# Replace `<div>` (from Chrome).
|
||||||
|
value = value.gsub(/<div>/i, "\n")
|
||||||
|
|
||||||
|
# Replace `<p>` (from IE).
|
||||||
|
value = value.gsub(/<p>/i, "\n")
|
||||||
|
|
||||||
|
# Remove extra tags.
|
||||||
|
value = value.gsub(/<(.*?)>/, '')
|
||||||
|
|
||||||
|
# Trim each line.
|
||||||
|
value = value.split("\n").map{|line| line.strip}.join("\n")
|
||||||
|
|
||||||
|
# No more than 2x newline, per "paragraph".
|
||||||
|
value = value.gsub(/\n\n+/, "\n\n")
|
||||||
|
|
||||||
|
# Clean up spaces.
|
||||||
|
value = value.gsub(/[ ]+/, ' ')
|
||||||
|
value = value.strip
|
||||||
|
|
||||||
|
# Expose string.
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
def self.fix_all_white_spaces
|
||||||
|
self.all.each do |event|
|
||||||
|
new_attrs = {}
|
||||||
|
localize_fields = ["title", "note"]
|
||||||
|
localize_fields.each do |f|
|
||||||
|
f_trans = "#{f}_translations"
|
||||||
|
new_attrs[f] = self.convertToText(event[f])
|
||||||
|
new_attrs[f_trans] = {}
|
||||||
|
event[f_trans].each do |l, s|
|
||||||
|
new_attrs[f_trans][l] = self.convertToText(s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Event.where(:id=>event.id).update_all(new_attrs)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -226,12 +226,50 @@
|
||||||
|
|
||||||
return indexed_array;
|
return indexed_array;
|
||||||
}
|
}
|
||||||
|
function convertToText(str){
|
||||||
|
// Ensure string.
|
||||||
|
var value = String(str);
|
||||||
|
|
||||||
|
// Convert encoding.
|
||||||
|
value = value.replace(/ /gi, ' ');
|
||||||
|
value = value.replace(/&/gi, '&');
|
||||||
|
|
||||||
|
// Replace `<br>`.
|
||||||
|
value = value.replace(/<br>/gi, '\n');
|
||||||
|
|
||||||
|
// Replace `<div>` (from Chrome).
|
||||||
|
value = value.replace(/<div>/gi, '\n');
|
||||||
|
|
||||||
|
// Replace `<p>` (from IE).
|
||||||
|
value = value.replace(/<p>/gi, '\n');
|
||||||
|
|
||||||
|
// Remove extra tags.
|
||||||
|
value = value.replace(/<(.*?)>/g, '');
|
||||||
|
|
||||||
|
// Trim each line.
|
||||||
|
value = value
|
||||||
|
.split('\n')
|
||||||
|
.map((line = '') => {
|
||||||
|
return line.trim();
|
||||||
|
})
|
||||||
|
.join('\n');
|
||||||
|
|
||||||
|
// No more than 2x newline, per "paragraph".
|
||||||
|
value = value.replace(/\n\n+/g, '\n\n');
|
||||||
|
|
||||||
|
// Clean up spaces.
|
||||||
|
value = value.replace(/[ ]+/g, ' ');
|
||||||
|
value = value.trim();
|
||||||
|
|
||||||
|
// Expose string.
|
||||||
|
return value;
|
||||||
|
};
|
||||||
function before_submit(ele){
|
function before_submit(ele){
|
||||||
var self = $(ele).parents('form')
|
var self = $(ele).parents('form')
|
||||||
var content_editables = self.find('*[contenteditable="true"]');
|
var content_editables = self.find('*[contenteditable="true"]');
|
||||||
for (var i=0,length = content_editables.length; i<length; i++){
|
for (var i=0,length = content_editables.length; i<length; i++){
|
||||||
var tp1 = content_editables.eq(i);
|
var tp1 = content_editables.eq(i);
|
||||||
tp1.siblings('input[type="hidden"]').val(tp1.html());
|
tp1.siblings('input[type="hidden"]').val(convertToText(tp1.html()));
|
||||||
}
|
}
|
||||||
self.submit();
|
self.submit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ Rails.application.routes.draw do
|
||||||
update_flag = s.respond_to?(:tmp_flags)
|
update_flag = s.respond_to?(:tmp_flags)
|
||||||
need_update = !update_flag || !(s.tmp_flags.include?('cf2'))
|
need_update = !update_flag || !(s.tmp_flags.include?('cf2'))
|
||||||
need_update2 = !update_flag || !(s.tmp_flags.include?('cf3'))
|
need_update2 = !update_flag || !(s.tmp_flags.include?('cf3'))
|
||||||
|
need_update3 = !update_flag || !(s.tmp_flags.include?('cf4'))
|
||||||
calendar_setting = CalendarSetting.first
|
calendar_setting = CalendarSetting.first
|
||||||
calendar_setting = CalendarSetting.create if calendar_setting.nil?
|
calendar_setting = CalendarSetting.create if calendar_setting.nil?
|
||||||
if need_update
|
if need_update
|
||||||
|
@ -48,6 +49,15 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
puts "Calendar fix!"
|
puts "Calendar fix!"
|
||||||
end
|
end
|
||||||
|
if need_update3
|
||||||
|
Event.fix_all_white_spaces
|
||||||
|
if update_flag
|
||||||
|
s = Site.first
|
||||||
|
s.tmp_flags << 'cf4'
|
||||||
|
s.save
|
||||||
|
end
|
||||||
|
puts "Calendar fix!"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
|
|
Loading…
Reference in New Issue