/
projectfilesControl.js
127 lines (96 loc) · 4.02 KB
/
projectfilesControl.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
// JavaScript Document
(function() {
function PROJECTFILESCONTROL() {
}
$PF = new PROJECTFILESCONTROL();
$PF.fn = PROJECTFILESCONTROL.prototype;
$PF.fn.init = function() {
};
$PF.fn.getThis = function() {
return this;
};
$PF.fn.setUpProjectFiles = function() {
// Put all javascript variable declarations at the top of the function.
var projectfiles = {
pipe : "projectfiles",
tableName : "projectfiles",
queryType : "select",
project : "BIT561"
},
filenames = [];
// Load the data into structure, a jagged associative array.
post(projectfiles);
filenames = $S.getType("projectfiles");
// Set up the category selector. Assumes the data objects have a category member.
if ( filenames.length > 0 ) {
$F.fillCategorySelector("projectfiles", "selectFileCategory");
}
// Display the first data value or a clear screen.
if ( filenames.length > 0 ) {
$F.present("projectfiles", filenames[0]);
} else {
$F.clearForm("projectfiles");
}
// Establish the carousel and set its events.
$C.setC(filenames);
$C.setSelect("fileselect", $C.getC(), "projectfiles", "name");
$C.makeEventHandlers("filecontrol", "projectfiles", $PF.bailout );
// Put an event on the category selector.
$("#selectFileCategory")
.change(function(e) {
$F.categorySelector(this, "fileselect", "projectfiles");
});
};
// Do nothing on bailout at the moment.
$PF.fn.bailout = function() {
};
})();
// Establish the helpful hints for the forms input elements.
$(document).ready( function() {
$("fieldset").click( function() {
var top = 0,
topStr = "",
message = "",
formLocation = {};
$("fieldset").css("background-color", "#FFFFFF");
$(this).css("background-color", "#DCCEA6");
formLocation = $(this).position();
top = Math.floor(formLocation.top) + 90;
topStr = top + "px";
$("#helpComments").css("top", topStr);
switch ($(this).attr("id")) {
case "source":
message = "Type in the location of the source code file being converted into HTML. ";
message += "If running this on local xampp server put in the complete location: drive, path, filename, and extension.";
message += "If running this on a public linux server put in the relitive paths from jumpPoint.php to your source file. Sample: jumpPoint.php";
break;
case "destination":
message = "Enter the location of the HTML file created by the autodoc conversion. ";
message += " If running on local xampp server put in the complete location: drive, path, filename, and extension.";
message += " If running on public linux server enter in relitave path from jumpPoint.php. Sample: ../doc/jumpPoint.html";
break;
case "project":
message = "Enter the name of the project files to be processed with the autodoc ";
message += "command.";
break;
case "name":
message = "Name is a short, one line description of the file being converted. ";
message += "Names are used in indexes and drop down selectors as a quick way ";
message += "to indicate which file is being chosen.";
break;
case "description":
message = "A longer description of the contents of a project source code file. ";
message += "The description can be used in a document describing all project ";
message += "work.";
break;
case "category":
message = "Creating categories such a php, css, etc., makes it easier to find ";
message += "particular files in projects with a large number of files.";
break;
default:
message = "";
break;
}
$("#helpComments").html(message);
});
});