forked from mitchgre/gregsList
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·129 lines (100 loc) · 2.52 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
$(document).ready
(
function()
{
// setup tabs via jQuery-ui
$("#encapsulator").tabs();
// $("#calendar").resizable();
setupCalendar('#calendar');
// getPostings();
gregsList = new glo(); // main object
// gregsList.setupPostings();
// display postings, companies, contacts, goals
// get and display job postings
// getStuff(gregsList.postings);
// getStuff(gregsList.companies);
setupPortlets();
//$("#companiesPortlet").clone($("#tableOfCompanies"));
// $("#tableOfCompanies").clone().appendTo( "#companiesPortlet" );
//$("#postingsPortlet").append($("#tableOfPostings"));
//$("#calendarPortlet").css("width","66%");
setupCalendar('#calendarPortlet');
// console.log("getter = ");
// console.log(gregsList.postings.get);
}
);
/*
A basic setup for the jQuery full calendar.
http://fullcalendar.io/
*/
function setupCalendar(divId)
{
$(divId).fullCalendar
(
{
header:
{
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true,
droppable: true,
selectable: true,
selectHelper:true,
select: function(start, end)
{
var title = prompt('Event Title:');
var eventData;
if (title) {
eventData =
{
title: title,
start: start,
end: end
};
$(divId).fullCalendar('renderEvent', eventData, true); // stick? = true
}
$(divId).fullCalendar('unselect');
},
//theme: true,
// resizable: true,
events:
[
{
title: 'get calendar working',
start: '2015-03-07T23:00:00',
end: '2015-03-11T23:59:00'
}
]
}
);
}
/*
A basic setup for jQuery ui portlets.
http://jqueryui.com/sortable/#portlets
Portlets will contain a non-ediable overview of the users data.
*/
function setupPortlets()
{
$(".column").sortable
(
{
connectWith: ".column",
handle: ".portlet-header",
cancel: ".portlet-toggle",
placeholder: "portlet-placeholder ui-corner-all"
}
);
$( ".portlet" )
.addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-minusthick portlet-toggle'></span>");
$( ".portlet-toggle" ).click(function() {
var icon = $( this );
icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" );
icon.closest( ".portlet" ).find( ".portlet-content" ).toggle();
});
$(".portlet").resizable().css({overflow:'auto'});
}