34 |
35 | ## Table of Contents
36 | - [Quickstart](#quickstart)
37 | - [Documentation](#documentation)
38 | - [Supported Browsers](#supported-browsers)
39 | - [Changelog](#changelog)
40 | - [Testing](#testing)
41 | - [Contributing](#contributing)
42 | - [Copyright and license](#copyright-and-license)
43 |
44 | ## Quickstart:
45 | Read the [getting started guide](http://materializecss.com/getting-started.html) for more information on how to use materialize.
46 |
47 | - [Download the latest release](https://github.com/Dogfalo/materialize/releases/latest) of materialize directly from GitHub. ([Beta](https://github.com/Dogfalo/materialize/releases/))
48 | - Clone the repo: `git clone https://github.com/Dogfalo/materialize.git` (Beta: `git clone -b v1-dev https://github.com/Dogfalo/materialize.git`)
49 | - Include the files via [cdnjs](https://cdnjs.com/libraries/materialize). More [here](http://materializecss.com/getting-started.html). ([Beta](https://cdnjs.com/libraries/materialize/1.0.0-beta))
50 | - Install with [npm](https://www.npmjs.com): `npm install materialize-css` (Beta: `npm install materialize-css@next`)
51 | - Install with [Bower](https://bower.io): `bower install materialize` ([DEPRECATED](https://bower.io/blog/2017/how-to-migrate-away-from-bower/))
52 | - Install with [Atmosphere](https://atmospherejs.com): `meteor add materialize:materialize` (Beta: `meteor add materialize:materialize@=1.0.0-beta`)
53 |
54 | ## Documentation
55 | The documentation can be found at . To run the documentation locally on your machine, you need [Node.js](https://nodejs.org/en/) installed on your computer.
56 |
57 | ### Running documentation locally
58 | Run these commands to set up the documentation:
59 |
60 | ```bash
61 | git clone https://github.com/Dogfalo/materialize
62 | cd materialize
63 | npm install
64 | ```
65 |
66 | Then run `grunt monitor` to compile the documentation. When it finishes, open a new browser window and navigate to `localhost:8000`. We use [BrowserSync](https://www.browsersync.io/) to display the documentation.
67 |
68 | ### Documentation for previous releases
69 | Previous releases and their documentation are available for [download](https://github.com/Dogfalo/materialize/releases).
70 |
71 | ## Supported Browsers:
72 | Materialize is compatible with:
73 |
74 | - Chrome 35+
75 | - Firefox 31+
76 | - Safari 9+
77 | - Opera
78 | - Edge
79 | - IE 11+
80 |
81 | ## Changelog
82 | For changelogs, check out [the Releases section of materialize](https://github.com/Dogfalo/materialize/releases) or the [CHANGELOG.md](CHANGELOG.md).
83 |
84 | ## Testing
85 | We use Jasmine as our testing framework and we're trying to write a robust test suite for our components. If you want to help, [here's a starting guide on how to write tests in Jasmine](CONTRIBUTING.md#jasmine-testing-guide).
86 |
87 | ## Contributing
88 | Check out the [CONTRIBUTING document](CONTRIBUTING.md) in the root of the repository to learn how you can contribute. You can also browse the [help-wanted](https://github.com/Dogfalo/materialize/labels/help-wanted) tag in our issue tracker to find things to do.
89 |
90 | ## Copyright and license
91 | Code Copyright 2018 Materialize. Code released under the MIT license.
92 |
--------------------------------------------------------------------------------
/app/menu.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | MSC ROUTINE GENERATOR
6 |
7 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/app/editSubject.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Edit Subjects
5 |
27 |
28 |
29 |
34 |
36 |
37 |
38 |
39 |
192 |
193 |
--------------------------------------------------------------------------------
/app/app.js:
--------------------------------------------------------------------------------
1 | const electron = require('electron');
2 | const path = require('path');
3 | const url = require('url');
4 | process.env.NODE_ENV = 'development';
5 | const {app, BrowserWindow, Menu, ipcMain} = electron;
6 | const fs = require('fs');
7 | const os = require('os');
8 | const {shell} = require('electron') // deconstructing assignment
9 | const dir_prefix_name = app.getAppPath();
10 | const pdf_path = dir_prefix_name + "/pdf_dir/";
11 | const word_path = dir_prefix_name + "/word_dir/";
12 | let db='';
13 | let mainWindow;
14 | let addWindow;
15 | let Table_name = "";
16 |
17 |
18 | app.on('window-all-closed', function() {
19 | app.quit();
20 | });
21 |
22 | // This method will be called when Electron has done everything
23 | // initialization and ready for creating browser windows.
24 | app.on('ready', function() {
25 | // Create the browser window.
26 | mainWindow = new BrowserWindow({width: 1000, height: 720});
27 | mainWindow.loadURL(url.format({
28 | pathname: path.join(__dirname, 'menu.html'),
29 | protocol: 'file:',
30 | slashes:true
31 | }));
32 |
33 | // Emitted when the window is closed.
34 | mainWindow.on('closed', function() {
35 | // Dereference the window object, usually you would store windows
36 | // in an array if your app supports multi windows, this is the time
37 | // when you should delete the corresponding element.
38 | mainWindow = null;
39 | app.quit();
40 | });
41 |
42 | /*
43 | // Build menu from template
44 | const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);
45 | // Insert menu
46 | Menu.setApplicationMenu(mainMenu);
47 | */
48 | });
49 |
50 | // Handle add item window
51 | function createWindow(TITLE,HTML_FILE){
52 | addWindow = new BrowserWindow({
53 | show:false,
54 | width: 1000,
55 | height:720,
56 | title:TITLE,
57 | //titleBarStyle: 'default',
58 | parent: mainWindow
59 | });
60 | addWindow.once('ready-to-show', () => {
61 | addWindow.show()
62 | });
63 | addWindow.loadURL(url.format({
64 | pathname: path.join(__dirname, HTML_FILE),
65 | protocol: 'file:',
66 | slashes:true
67 | }));
68 |
69 | //const menu = new Menu();
70 | // Handle garbage collection
71 |
72 | addWindow.on('close', function(){
73 | addWindow = null;
74 | });
75 | return addWindow;
76 | }
77 |
78 |
79 | // Catch item:add
80 | ipcMain.on('Teacher:add', function(e, teacher_name, teacher_initials){
81 | mainWindow.webContents.send('Teacher:Store',teacher_name, teacher_initials);
82 | addWindow.close();
83 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
84 | //addWindow = null;
85 | });
86 |
87 | ipcMain.on('Supervisor:add', function(e, Supervisor_name, Supervisor_initials, Supervisor_position){
88 | // console.log(Supervisor_name);
89 | // console.log(Supervisor_initials);
90 | // console.log(Supervisor_position);
91 | mainWindow.webContents.send('Supervisor:Store',Supervisor_name, Supervisor_initials,Supervisor_position);
92 | addWindow.close();
93 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
94 | //addWindow = null;
95 | });
96 |
97 |
98 | ipcMain.on('Subject:add', function(e, Subject_name){
99 | mainWindow.webContents.send('Subject:Store',Subject_name);
100 | addWindow.close();
101 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
102 | //addWindow = null;
103 | });
104 |
105 |
106 | ipcMain.on('Database:add', function(e, item){
107 | console.log(item);
108 | mainWindow.webContents.send('DataBase:Create', item);
109 | addWindow.close();
110 | createWindow("Students' Routine", "index.html");
111 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
112 | //addWindow = null;
113 | });
114 |
115 | ipcMain.on('Routine:add', function(e, Routine_name, batch_yr, prog_full, prog_acr, year_rot, yr_part){
116 | Table_name = Routine_name;
117 | console.log(Table_name);
118 | mainWindow.webContents.send('Routine:Create', Table_name,batch_yr, prog_full, prog_acr, year_rot, yr_part);
119 | addWindow.close();
120 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
121 | //addWindow = null;
122 | });
123 |
124 |
125 | ipcMain.on('Routine:old', function(e, Routine_name){
126 | Table_name = Routine_name;
127 | console.log(Table_name);
128 | mainWindow.webContents.send('Routine:append', Table_name);
129 | addWindow.close();
130 | // Still have a reference to addWindow in memory. Need to reclaim memory (Grabage collection)
131 | //addWindow = null;
132 | });
133 |
134 |
135 | //EDIT FROM PRASHANT
136 | //Button clicks handler.
137 | //Every button in the program sends a "button clicked" event and ID as the parameter.
138 | //some clicks might not have functionality.
139 |
140 | ipcMain.on('buttonClicked', function(e, buttonId){
141 | if(buttonId==="newRoutine"){
142 | createWindow("New Routine","RoutineName.html");
143 | // mainWindow.webContents.send("dbName",db_name ,dir_prefix_name);
144 | }
145 |
146 | else if(buttonId=="oldRoutine"){
147 | createWindow("old Routine","oldRoutine.html");
148 | console.log("update old routine");
149 | }
150 |
151 | else if(buttonId == "editTeacher"){
152 | createWindow("Edit Teacher","editTeacher.html");
153 | }
154 |
155 | else if(buttonId=="editCourse"){
156 | createWindow("Edit Course","editSubject.html");
157 | }
158 |
159 | else if(buttonId == "addTeacher"){
160 | createWindow("Add Teacher","addTeacher.html");
161 | }
162 |
163 | else if(buttonId=="addCourse"){
164 | createWindow("Add Course","addSubject.html");
165 | }
166 | else if(buttonId=="addSupervisor"){
167 | createWindow("Add Course","addSupervisor.html");
168 | }
169 | else if(buttonId=="editSupervisor"){
170 | createWindow("Add Course","Edit_supervisor.html");
171 | }
172 |
173 |
174 | // else if(buttonId=="saveRoutine"){
175 | // createWindow("Name of Routine", "databaseName.html");
176 | // }
177 | });
178 |
179 |
180 | // pdf print function
181 | //closing the window by "cancel" button.
182 | ipcMain.on('closeWindow', function(e){
183 | addWindow.close();
184 | });
185 |
186 | ipcMain.on('return_menu', function(e){
187 | mainWindow.loadURL('file://' + __dirname + '/menu.html');
188 |
189 | });
190 |
191 | ipcMain.on('hideWindow', function(e){
192 | addWindow.hide();
193 | });
194 |
195 | // ipcMain.on('print-to-pdf', function(event, table_name){
196 | // table_name_ext = table_name + '.pdf'
197 | // const pdfPath = path.join(pdf_path, table_name_ext);
198 | // console.log(pdfPath);
199 | // const win = BrowserWindow.fromWebContents(event.sender);
200 |
201 | // win.webContents.printToPDF({}, (error, data) => {
202 | // if (error) return console.log(error.message);
203 |
204 | // fs.writeFile(pdfPath, data, err => {
205 | // if (err) return console.log(err.message);
206 | // shell.openExternal('file://' + pdfPath);
207 | // event.sender.send('wrote-pdf', pdfPath);
208 | // })
209 |
210 | // })
211 | // });
212 |
213 | // Receiving communication from index.html for new window creation and passing table_name info to main process..ie..app.js
214 |
215 | ipcMain.on('print-to-Word', function(event, table_name) {
216 | Table_name = table_name;
217 | secondWindow = createWindow("Word","printable.html");
218 | });
219 |
220 | //receiving communication from printable.html for quering Routine_name information
221 |
222 | ipcMain.on('print-to-Word2',function(e){
223 | console.log("yaay");
224 | console.log(Table_name);
225 | secondWindow.webContents.send('doc_name', Table_name);
226 | });
227 |
--------------------------------------------------------------------------------
/app/printable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 | Printable Routine
14 |
15 |
16 |
17 |
18 |
522 |
523 |
524 |
525 |
--------------------------------------------------------------------------------
/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MSC_Routine_Generator
5 |
6 |
7 |
8 |
9 |
10 |
11 | TRIBHUVAN UNIVERSITY INSTITUTE OF ENGINEERING , PULCHOWK CAMPUS Department of Electronics and Computer Engineering
12 | M.sc. Program
13 |
14 |