Skip to content

Commit 2e1aa41

Browse files
committed
Removed function __proto__ tweak for HereDocs - IE got confused
1 parent 54f3bfb commit 2e1aa41

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

css/test.css

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
h1 {
2-
margin-left: 180px; }
1+
.header {
2+
margin-left: 180px;
3+
width: 640px; }
34

45
.rc_bodyweek {
56
height: 400px;
@@ -10,16 +11,18 @@ h1 {
1011
margin-left: 180px; }
1112

1213
.event_palette {
14+
border-right: 1px solid #888888;
1315
position: fixed;
14-
top: 50px;
15-
left: 10px; }
16+
top: 10px;
17+
left: 10px;
18+
width: 160px; }
1619

1720
.unassigned {
18-
top: 300px;
21+
top: 330px;
1922
background: #FFD;
2023
width: 160px;
2124
min-height: 180px;
22-
border: 1px solid #888800;
25+
border-right: 1px solid #888800;
2326
text-align: center; }
2427
.unassigned h2 {
2528
font-size: 18px;
@@ -31,7 +34,9 @@ h1 {
3134

3235
.in_palette {
3336
-webkit-box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
34-
box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.2); }
37+
box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.2);
38+
margin-left: auto;
39+
margin-right: auto; }
3540

3641
.event {
3742
background: rgba(255, 255, 255, 0.6);

templates/week.template.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Multiline Function String - Nate Ferrero - Public Domain
2-
(function(){}).__proto__.heredoc = function() {
3-
return this.toString().replace(/.*\/\*\n([\s\S]*)\n\*\/.*/m, "$1");
4-
};
5-
61

72
// [TODO] Add support for per-day opening/closing times
83

@@ -59,7 +54,7 @@ var render_week = doT.template((function(){/*
5954
$('.calimg').click(function(){ $(this).datepicker( "dialog", {{= it.baseDate }}, dateSelect ) });
6055
}}
6156
62-
*/}).heredoc());
57+
*/}).toString().replace(/.*\/\*\n([\s\S]*)\n\*\/.*/m, "$1"));
6358

6459

6560
//
@@ -100,6 +95,8 @@ var render_week_event = doT.template((function(){/*
10095
<div class="rc_event_body">{{=it.attr.ev_text}}
10196
{{? it.attr.locked }}<img class='lockedevent' alt='locked' src='img/padlock.png'></img>{{?}}
10297
</div>
98+
{{? it.attr.resource != "unassigned_event_resource"}}
10399
<div class="rc_event_postpad" style="height:{{=it.attr.t_postpad}}px;"></div>
100+
{{?}}
104101
</div>
105-
*/}).heredoc());
102+
*/}).toString().replace(/.*\/\*\n([\s\S]*)\n\*\/.*/m, "$1"));

test.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@
99
<link rel="stylesheet" type="text/css" href="css/test.css">
1010
</head>
1111
<body>
12-
<h1>Resource Calendar Demo Page</h1>
12+
<div class='header'>
13+
<h1>Resource Calendar Demo Page</h1>
14+
<p>Rendering of calendars and events has been abstracted out to a javascript template file that
15+
uses the "doT.js" templating system [<a href='http://olado.github.io/doT/'>http://olado.github.io/doT/</a>].
16+
This layout is just one possible way to use the Resource Calendar system; it is fully customizable.</p>
17+
<p>Source code for the Resource Calendar jquery plugin, and a description of functionality implemented so far, can be found at: <a href="https://github.com/geekbrit/ResCal">https://github.com/geekbrit/ResCal</a></p>
18+
</div>
1319
<div class='event_palette'>
20+
<p>Drag these to a calendar<br>to create a meeting</p>
1421
<div class='ip_spacing'><div class='rc_event client event in_palette' data-evtype='client' ><p>Client Meeting</p></div></div>
1522
<div class='ip_spacing'><div class='rc_event internal event in_palette' data-evtype='internal' ><p>Internal Meeting</p></div></div>
1623
<div class='ip_spacing'><div class='rc_event vendor event in_palette' data-evtype='vendor' ><p>Vendor Meeting</p></div></div>

0 commit comments

Comments
 (0)