jsgui3-server 0.0.75 → 0.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/client-side-popup-menu-button.html +93 -93
- package/examples/controls/_html-server-color-palette.js +114 -114
- package/examples/controls/html-server-combo-box.js +104 -104
- package/examples/controls/html-server-list.js +98 -98
- package/examples/controls/html-server-popup-menu-button.js +114 -114
- package/examples/controls/html-server-start-stop-toggle-button.js +146 -146
- package/examples/controls/scs-arrow-button.js +36 -36
- package/examples/controls/scs-date-picker.js +157 -157
- package/examples/controls/scs-file-browser.js +82 -82
- package/examples/controls/scs-item.js +159 -159
- package/examples/controls/scs-month-arrow-selector.js +126 -126
- package/examples/controls/scs-month-view.js +95 -95
- package/examples/controls/scs-start-stop-toggle-button.js +40 -40
- package/examples/controls/scs-tree.js +49 -49
- package/examples/controls/scs-year-arrow-selector.js +127 -127
- package/examples/demos/date-picker.js +119 -119
- package/examples/demos/explain-encapsulation.js +9 -9
- package/examples/demos/resizing.js +35 -35
- package/examples/demos/server_time.js +6 -6
- package/examples/demos/square_box.js +324 -324
- package/examples/html-rendering.js +20 -20
- package/examples/html-server.js +100 -100
- package/fs2.js +1836 -1836
- package/module.js +21 -21
- package/old/single-control-server.js +418 -418
- package/package.json +44 -42
- package/publishing/function-publisher.js +202 -202
- package/publishing/notes.md +5 -5
- package/publishing/observable-publisher.js +118 -118
- package/publishing/resource-publisher.js +306 -306
- package/resources/data-resource.js +104 -104
- package/resources/fs-resource.js +148 -148
- package/resources/jsbuilder/Abstract_Single_Declaration.js +105 -0
- package/resources/jsbuilder/Abstract_Single_Declaration_Sequence.js +43 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Abstract_Node.js +62 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Abstract_Node_Group.js +42 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Group_Shared.js +62 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node.js +94 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_0-Core.js +228 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_1-Babel.js +338 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_10-Changing.js +40 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.1.1-Child.js +97 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.1.2-Parent.js +38 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.1.3-Ancestor.js +62 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.2-Inner.js +44 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.3-All.js +73 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.4-Sibling.js +93 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.5-Available_In_Scope.js +29 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_2.9-Signature.js +116 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3-Basics.js +160 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.0.0-Basics_First.js +179 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.0.1-Basics_Second.js +88 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.0.99-Basics_Last.js +92 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.1-Basics_Each.js +137 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.1.5-Basics_Count.js +74 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.2-Basics_Filter.js +40 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.3-Basics_Collect.js +86 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.4-Basics_Select.js +43 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.5-Basics_Find.js +41 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_3.6-Basics_Callmap.js +55 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_4.0-Index_Indexes.js +46 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_4.1-Index.js +344 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.0-Category.js +39 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.1-Category_Identifier.js +31 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.2-Category_Literal.js +29 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.3-Category_Expression.js +27 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.4-Category_Pattern.js +9 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.5-Category_Declaration.js +44 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_5.6-Category_Statement.js +22 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_6.0-Type.js +87 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_6.1-Type_Class_Declaration.js +9 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_6.2-Type_Variable_Declaration.js +28 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_6.3-Type_Variable_Declarator.js +29 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_7-Query.js +737 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_8-Features.js +65 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_9-Planning.js +32 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Arrangement.js +15 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Node_Declared_Object.js +306 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Node_Feature.js +78 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Node_Feature_Declaration.js +249 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Node_Feature_Declarator.js +139 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/JS_AST_Root_Node_Feature.js +10 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/JS_AST_Root_Node_Feature_Exported.js +101 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/JS_AST_Root_Node_Feature_Exports.js +61 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/JS_AST_Root_Node_Interpreted.js +180 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/_JSGUI_Root_Node_Interpreted.js +43 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Feature/JS_AST_Root_Node_Feature/special_case_objectassign_to_object.js +12 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Node_Group.js +35 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Operation.js +11 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Operation_On_Relationship.js +32 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Ordered_Relationship_Node_To_Group.js +38 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Ordinal.js +40 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Ordinal_Relationship.js +25 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Relationship_Node_To_Group.js +201 -0
- package/resources/jsbuilder/JS_AST/JS_AST_Relationship_Node_Within_Group_To_Node.js +44 -0
- package/resources/jsbuilder/JS_AST/_JS_AST_Node_3.8-Query_Features.js +77 -0
- package/resources/jsbuilder/JS_AST/query/all.js +0 -0
- package/resources/jsbuilder/JS_AST/query/enable_array_as_queryable.js +228 -0
- package/resources/jsbuilder/JS_AST/query/find_object_keys.js +405 -0
- package/resources/jsbuilder/JS_AST/query/node_queries.js +9 -0
- package/resources/jsbuilder/JS_AST/query/root_queries.js +0 -0
- package/resources/jsbuilder/JS_AST/query/root_query_identidy.js +12 -0
- package/resources/jsbuilder/JS_AST_Node_Extended/JSGUI_Singular_Declaration.js +86 -0
- package/resources/jsbuilder/JS_AST_Node_Extended/JS_AST_Node_Declaration.js +124 -0
- package/resources/jsbuilder/JS_AST_Node_Extended/JS_AST_Node_Extended.js +88 -0
- package/resources/jsbuilder/JS_AST_Node_Extended/JS_AST_Node_Extended_0-Core.js +11 -0
- package/resources/jsbuilder/JS_Builder.js +10 -36
- package/resources/jsbuilder/JS_File/Feature/JS_File_Declared_Object.js +32 -0
- package/resources/jsbuilder/JS_File/Feature/JS_File_Exported_Object_Info.js +26 -0
- package/resources/jsbuilder/JS_File/Feature/JS_File_Exports.js +79 -0
- package/resources/jsbuilder/JS_File/Feature/JS_File_Feature.js +18 -0
- package/resources/jsbuilder/JS_File/Feature/JS_File_Imported_Object_Info.js +26 -0
- package/resources/jsbuilder/JS_File/Feature/JS_File_Imports.js +9 -0
- package/resources/jsbuilder/JS_File/JS_File.js +12 -0
- package/resources/jsbuilder/JS_File/JS_File_0-Core.js +202 -0
- package/resources/jsbuilder/JS_File/JS_File_1-Early_Parse.js +175 -0
- package/resources/jsbuilder/JS_File/JS_File_2-Babel.js +81 -0
- package/resources/jsbuilder/JS_File/JS_File_3-JS_AST_Node.js +86 -0
- package/resources/jsbuilder/JS_File/JS_File_4-Query.js +414 -0
- package/resources/jsbuilder/JS_File/JS_File_4.1-Query_Features.js +415 -0
- package/resources/jsbuilder/JS_File/JS_File_5-Planning.js +59 -0
- package/resources/jsbuilder/JS_File/JS_File_6-Changing.js +24 -0
- package/resources/jsbuilder/JS_File/JS_File_Export_Reference.js +12 -0
- package/resources/jsbuilder/JS_File/JS_File_Import_Reference.js +24 -0
- package/resources/jsbuilder/JS_File/JS_File_Import_References.js +32 -0
- package/resources/jsbuilder/JS_File/JS_File_Processor.js +16 -0
- package/resources/jsbuilder/JS_File/JS_Files.js +16 -0
- package/resources/jsbuilder/Module.js +14 -0
- package/resources/jsbuilder/Platform.js +13 -53
- package/resources/jsbuilder/Platforms.js +69 -15
- package/resources/jsbuilder/Project.js +109 -0
- package/resources/jsbuilder/Reference.js +1 -1
- package/resources/jsbuilder/Reference_Sequence.js +16 -7
- package/resources/jsbuilder/Scope.js +30 -0
- package/resources/jsbuilder/Variable_Name_Provider.js +43 -0
- package/resources/jsbuilder/_JS_File.js +226 -0
- package/resources/jsbuilder/ast_query.js +21 -0
- package/resources/jsbuilder/babel/babel_consts.js +150 -0
- package/resources/jsbuilder/babel/babel_node_tools.js +542 -0
- package/resources/jsbuilder/babel/deep_iterate/deep_iterate_babel.js +604 -0
- package/resources/jsbuilder/build.js +16 -0
- package/resources/jsbuilder/platform_notes.md +66 -0
- package/resources/jsbuilder/test/test_ast_node.js +451 -0
- package/resources/jsbuilder/test/test_js_file.js +303 -11
- package/resources/jsbuilder/test/test_project.js +157 -0
- package/resources/local-server-info-resource.js +78 -78
- package/resources/process-js.js +537 -537
- package/resources/server-resource-pool.js +84 -84
- package/resources/website-css-resource.js +411 -411
- package/resources/website-javascript-resource.js +761 -751
- package/resources/website-resource.js +390 -390
- package/resources/website-static-html-resource.js +196 -196
- package/server.js +170 -170
- package/single-control-server.js +398 -398
- package/single-page-app.js +129 -129
- package/resources/jsbuilder/Declaration.js +0 -15
- package/resources/jsbuilder/Declaration_Sequence.js +0 -15
- package/resources/jsbuilder/JS_File.js +0 -77
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Client-side Popup Menu Button</title>
|
|
5
|
-
<link rel="stylesheet" type="text/css" href="css/basic.css">
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<div id="menu_here"></div>
|
|
9
|
-
</body>
|
|
10
|
-
|
|
11
|
-
<script src="js/app-bundle-active.js"></script>
|
|
12
|
-
<script language="javascript">
|
|
13
|
-
|
|
14
|
-
var el_popup_menu = document.getElementById('menu_here');
|
|
15
|
-
|
|
16
|
-
// Each item could be defined as an array.
|
|
17
|
-
|
|
18
|
-
var arr_items_0 = [
|
|
19
|
-
["Load and Preallocate", (e) => {
|
|
20
|
-
console.log("Load and Preallocate", e);
|
|
21
|
-
console.trace();
|
|
22
|
-
}],
|
|
23
|
-
["Smart Allocation", (e) => {
|
|
24
|
-
console.log("Smart Allocation", e);
|
|
25
|
-
}],
|
|
26
|
-
["Add Travel Time", (e) => {
|
|
27
|
-
console.log("Add Travel Time", e);
|
|
28
|
-
}],
|
|
29
|
-
["Print Rosters", (e) => {
|
|
30
|
-
console.log("Print Rosters", e);
|
|
31
|
-
}],
|
|
32
|
-
["Email Rosters", (e) => {
|
|
33
|
-
console.log("Email Rosters", e);
|
|
34
|
-
}]
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
var arr_items = [
|
|
38
|
-
"Load and Preallocate",
|
|
39
|
-
"Smart Allocation",
|
|
40
|
-
"Add Travel Time",
|
|
41
|
-
"Print Rosters",
|
|
42
|
-
"Email Rosters"
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
// Or, better to activate the document, then render the popup_menu_button?
|
|
46
|
-
// As it is, with the creation of the control before document activation, it has no element to attach its DOM events to as they are defined.
|
|
47
|
-
// For the moment, getting it to attach its events to the DOM at the right time seems like the best approach.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// Better to activate / setup an individual component with jsgui rather than activate the whole document.
|
|
52
|
-
var popup_menu_button = new jsgui.Popup_Menu_Button({
|
|
53
|
-
'context': page_context,
|
|
54
|
-
'el': el_popup_menu,
|
|
55
|
-
'label': 'Actions',
|
|
56
|
-
'items': arr_items_0
|
|
57
|
-
});
|
|
58
|
-
popup_menu_button.active();
|
|
59
|
-
console.log('popup_menu_button', popup_menu_button);
|
|
60
|
-
|
|
61
|
-
popup_menu_button.all_html_render((err, html) => {
|
|
62
|
-
if (err) {
|
|
63
|
-
throw err;
|
|
64
|
-
} else {
|
|
65
|
-
//console.log('html', html);
|
|
66
|
-
el_popup_menu.outerHTML = html;
|
|
67
|
-
//console.log('pre activate');
|
|
68
|
-
//popup_menu_button.activate(el_popup_menu);
|
|
69
|
-
|
|
70
|
-
page_context.update_Controls('item', jsgui.Item);
|
|
71
|
-
page_context.update_Controls('combo_box', jsgui.Combo_Box);
|
|
72
|
-
page_context.update_Controls('popup_menu_button', jsgui.Popup_Menu_Button);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// this._bound_general_handler;
|
|
77
|
-
|
|
78
|
-
// Activation should attach the DOM events that are not attached?
|
|
79
|
-
|
|
80
|
-
jsgui.activate(page_context);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
["Load and Preallocate", "sch_LoadandAllocate.a5w", [300, 200]],
|
|
86
|
-
["Smart Allocation", "sch_Autofill.a5w", [300, 200]],
|
|
87
|
-
["Add Travel Time", "sch_addTravel.a5w", [300, 400]],
|
|
88
|
-
["Print Rosters", "sch_PrintRosters.a5w", [300, 400]],
|
|
89
|
-
["Email Rosters", "sch_EmailRosters.a5w", [300, 400]]
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</script>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Client-side Popup Menu Button</title>
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="css/basic.css">
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div id="menu_here"></div>
|
|
9
|
+
</body>
|
|
10
|
+
|
|
11
|
+
<script src="js/app-bundle-active.js"></script>
|
|
12
|
+
<script language="javascript">
|
|
13
|
+
|
|
14
|
+
var el_popup_menu = document.getElementById('menu_here');
|
|
15
|
+
|
|
16
|
+
// Each item could be defined as an array.
|
|
17
|
+
|
|
18
|
+
var arr_items_0 = [
|
|
19
|
+
["Load and Preallocate", (e) => {
|
|
20
|
+
console.log("Load and Preallocate", e);
|
|
21
|
+
console.trace();
|
|
22
|
+
}],
|
|
23
|
+
["Smart Allocation", (e) => {
|
|
24
|
+
console.log("Smart Allocation", e);
|
|
25
|
+
}],
|
|
26
|
+
["Add Travel Time", (e) => {
|
|
27
|
+
console.log("Add Travel Time", e);
|
|
28
|
+
}],
|
|
29
|
+
["Print Rosters", (e) => {
|
|
30
|
+
console.log("Print Rosters", e);
|
|
31
|
+
}],
|
|
32
|
+
["Email Rosters", (e) => {
|
|
33
|
+
console.log("Email Rosters", e);
|
|
34
|
+
}]
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
var arr_items = [
|
|
38
|
+
"Load and Preallocate",
|
|
39
|
+
"Smart Allocation",
|
|
40
|
+
"Add Travel Time",
|
|
41
|
+
"Print Rosters",
|
|
42
|
+
"Email Rosters"
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// Or, better to activate the document, then render the popup_menu_button?
|
|
46
|
+
// As it is, with the creation of the control before document activation, it has no element to attach its DOM events to as they are defined.
|
|
47
|
+
// For the moment, getting it to attach its events to the DOM at the right time seems like the best approach.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
// Better to activate / setup an individual component with jsgui rather than activate the whole document.
|
|
52
|
+
var popup_menu_button = new jsgui.Popup_Menu_Button({
|
|
53
|
+
'context': page_context,
|
|
54
|
+
'el': el_popup_menu,
|
|
55
|
+
'label': 'Actions',
|
|
56
|
+
'items': arr_items_0
|
|
57
|
+
});
|
|
58
|
+
popup_menu_button.active();
|
|
59
|
+
console.log('popup_menu_button', popup_menu_button);
|
|
60
|
+
|
|
61
|
+
popup_menu_button.all_html_render((err, html) => {
|
|
62
|
+
if (err) {
|
|
63
|
+
throw err;
|
|
64
|
+
} else {
|
|
65
|
+
//console.log('html', html);
|
|
66
|
+
el_popup_menu.outerHTML = html;
|
|
67
|
+
//console.log('pre activate');
|
|
68
|
+
//popup_menu_button.activate(el_popup_menu);
|
|
69
|
+
|
|
70
|
+
page_context.update_Controls('item', jsgui.Item);
|
|
71
|
+
page_context.update_Controls('combo_box', jsgui.Combo_Box);
|
|
72
|
+
page_context.update_Controls('popup_menu_button', jsgui.Popup_Menu_Button);
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// this._bound_general_handler;
|
|
77
|
+
|
|
78
|
+
// Activation should attach the DOM events that are not attached?
|
|
79
|
+
|
|
80
|
+
jsgui.activate(page_context);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
["Load and Preallocate", "sch_LoadandAllocate.a5w", [300, 200]],
|
|
86
|
+
["Smart Allocation", "sch_Autofill.a5w", [300, 200]],
|
|
87
|
+
["Add Travel Time", "sch_addTravel.a5w", [300, 400]],
|
|
88
|
+
["Print Rosters", "sch_PrintRosters.a5w", [300, 400]],
|
|
89
|
+
["Email Rosters", "sch_EmailRosters.a5w", [300, 400]]
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</script>
|
|
94
94
|
</html>
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by James on 02/10/2016.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// This one will need to activate on the client.
|
|
6
|
-
// Really want the whole thing to be in one file.
|
|
7
|
-
// Possible to have a standard activation?
|
|
8
|
-
//
|
|
9
|
-
// Or we need to have a client-side control?
|
|
10
|
-
//
|
|
11
|
-
// Some of the wiring could be done automatically.
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
var jsgui = require('jsgui3-html');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var Start_Stop_Toggle_Button = jsgui.Start_Stop_Toggle_Button;
|
|
18
|
-
var Color_Palette = jsgui.Color_Palette;
|
|
19
|
-
|
|
20
|
-
var Server = require('../../server');
|
|
21
|
-
var port = 8000;
|
|
22
|
-
var Server_Page_Context = require('../../page-context');
|
|
23
|
-
|
|
24
|
-
var server = new Server({
|
|
25
|
-
'routes': {
|
|
26
|
-
'*': {
|
|
27
|
-
'name': 'HTML Server'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var resource_pool = server.resource_pool;
|
|
34
|
-
|
|
35
|
-
// Rendering single page controls makes a lot of sense.
|
|
36
|
-
// It means the activation code can be contained better there.
|
|
37
|
-
|
|
38
|
-
//console.log('resource_pool', resource_pool);
|
|
39
|
-
//console.log('resource_pool.resources', resource_pool.resources);
|
|
40
|
-
|
|
41
|
-
// The start stop toggle button would need to be registered on the client side.
|
|
42
|
-
// May be worth it to have the standard controls registered to start with.
|
|
43
|
-
// Or to have the app know which controls are used, so it can register them.
|
|
44
|
-
|
|
45
|
-
// Get the website resource
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Caching items / resources by type?
|
|
50
|
-
|
|
51
|
-
// Need to give the resources a name.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//var website = resource_pool.get_resource('Server Router');
|
|
55
|
-
|
|
56
|
-
//console.log('\n\n');
|
|
57
|
-
|
|
58
|
-
//console.log('resource_names', resource_pool.get_resource_names());
|
|
59
|
-
//throw 'stop';
|
|
60
|
-
var server_router = resource_pool.get_resource('Server Router');
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//console.log('server_router', server_router);
|
|
65
|
-
|
|
66
|
-
if (!server_router) {
|
|
67
|
-
throw 'no server_router';
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var routing_tree = server_router.routing_tree;
|
|
71
|
-
|
|
72
|
-
routing_tree.set('/', function (req, res) {
|
|
73
|
-
//console.log('root path / request');
|
|
74
|
-
var server_page_context = new Server_Page_Context({
|
|
75
|
-
'req': req,
|
|
76
|
-
'res': res,
|
|
77
|
-
'resource_pool': resource_pool
|
|
78
|
-
});
|
|
79
|
-
// Page_Bounds_Specifier
|
|
80
|
-
var hd = new jsgui.Client_HTML_Document({
|
|
81
|
-
'context': server_page_context
|
|
82
|
-
});
|
|
83
|
-
hd.include_client_css();
|
|
84
|
-
hd.include_js('/js/app-bundle-active.js');
|
|
85
|
-
var body = hd.body;
|
|
86
|
-
body.size = [800, 600];
|
|
87
|
-
var ctrl = new Color_Palette({
|
|
88
|
-
'context': server_page_context,
|
|
89
|
-
'size': [312, 312]
|
|
90
|
-
});
|
|
91
|
-
//var ctrl2 = new jsgui.Control({});
|
|
92
|
-
ctrl.resizable = true;
|
|
93
|
-
body.add(ctrl);
|
|
94
|
-
ctrl.active();
|
|
95
|
-
hd.all_html_render(function (err, deferred_html) {
|
|
96
|
-
if (err) {
|
|
97
|
-
throw err;
|
|
98
|
-
} else {
|
|
99
|
-
//console.log('deferred_html', deferred_html);
|
|
100
|
-
var mime_type = 'text/html';
|
|
101
|
-
//console.log('mime_type ' + mime_type);
|
|
102
|
-
res.writeHead(200, { 'Content-Type': mime_type });
|
|
103
|
-
res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
//console.log('pre server start');
|
|
109
|
-
server.start(port, function (err, cb_start) {
|
|
110
|
-
if (err) {
|
|
111
|
-
throw err;
|
|
112
|
-
} else {
|
|
113
|
-
console.log('master server started');
|
|
114
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Created by James on 02/10/2016.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// This one will need to activate on the client.
|
|
6
|
+
// Really want the whole thing to be in one file.
|
|
7
|
+
// Possible to have a standard activation?
|
|
8
|
+
//
|
|
9
|
+
// Or we need to have a client-side control?
|
|
10
|
+
//
|
|
11
|
+
// Some of the wiring could be done automatically.
|
|
12
|
+
//
|
|
13
|
+
|
|
14
|
+
var jsgui = require('jsgui3-html');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var Start_Stop_Toggle_Button = jsgui.Start_Stop_Toggle_Button;
|
|
18
|
+
var Color_Palette = jsgui.Color_Palette;
|
|
19
|
+
|
|
20
|
+
var Server = require('../../server');
|
|
21
|
+
var port = 8000;
|
|
22
|
+
var Server_Page_Context = require('../../page-context');
|
|
23
|
+
|
|
24
|
+
var server = new Server({
|
|
25
|
+
'routes': {
|
|
26
|
+
'*': {
|
|
27
|
+
'name': 'HTML Server'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var resource_pool = server.resource_pool;
|
|
34
|
+
|
|
35
|
+
// Rendering single page controls makes a lot of sense.
|
|
36
|
+
// It means the activation code can be contained better there.
|
|
37
|
+
|
|
38
|
+
//console.log('resource_pool', resource_pool);
|
|
39
|
+
//console.log('resource_pool.resources', resource_pool.resources);
|
|
40
|
+
|
|
41
|
+
// The start stop toggle button would need to be registered on the client side.
|
|
42
|
+
// May be worth it to have the standard controls registered to start with.
|
|
43
|
+
// Or to have the app know which controls are used, so it can register them.
|
|
44
|
+
|
|
45
|
+
// Get the website resource
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// Caching items / resources by type?
|
|
50
|
+
|
|
51
|
+
// Need to give the resources a name.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
//var website = resource_pool.get_resource('Server Router');
|
|
55
|
+
|
|
56
|
+
//console.log('\n\n');
|
|
57
|
+
|
|
58
|
+
//console.log('resource_names', resource_pool.get_resource_names());
|
|
59
|
+
//throw 'stop';
|
|
60
|
+
var server_router = resource_pool.get_resource('Server Router');
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
//console.log('server_router', server_router);
|
|
65
|
+
|
|
66
|
+
if (!server_router) {
|
|
67
|
+
throw 'no server_router';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var routing_tree = server_router.routing_tree;
|
|
71
|
+
|
|
72
|
+
routing_tree.set('/', function (req, res) {
|
|
73
|
+
//console.log('root path / request');
|
|
74
|
+
var server_page_context = new Server_Page_Context({
|
|
75
|
+
'req': req,
|
|
76
|
+
'res': res,
|
|
77
|
+
'resource_pool': resource_pool
|
|
78
|
+
});
|
|
79
|
+
// Page_Bounds_Specifier
|
|
80
|
+
var hd = new jsgui.Client_HTML_Document({
|
|
81
|
+
'context': server_page_context
|
|
82
|
+
});
|
|
83
|
+
hd.include_client_css();
|
|
84
|
+
hd.include_js('/js/app-bundle-active.js');
|
|
85
|
+
var body = hd.body;
|
|
86
|
+
body.size = [800, 600];
|
|
87
|
+
var ctrl = new Color_Palette({
|
|
88
|
+
'context': server_page_context,
|
|
89
|
+
'size': [312, 312]
|
|
90
|
+
});
|
|
91
|
+
//var ctrl2 = new jsgui.Control({});
|
|
92
|
+
ctrl.resizable = true;
|
|
93
|
+
body.add(ctrl);
|
|
94
|
+
ctrl.active();
|
|
95
|
+
hd.all_html_render(function (err, deferred_html) {
|
|
96
|
+
if (err) {
|
|
97
|
+
throw err;
|
|
98
|
+
} else {
|
|
99
|
+
//console.log('deferred_html', deferred_html);
|
|
100
|
+
var mime_type = 'text/html';
|
|
101
|
+
//console.log('mime_type ' + mime_type);
|
|
102
|
+
res.writeHead(200, { 'Content-Type': mime_type });
|
|
103
|
+
res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
//console.log('pre server start');
|
|
109
|
+
server.start(port, function (err, cb_start) {
|
|
110
|
+
if (err) {
|
|
111
|
+
throw err;
|
|
112
|
+
} else {
|
|
113
|
+
console.log('master server started');
|
|
114
|
+
}
|
|
115
115
|
});
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by James on 02/10/2016.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// This one will need to activate on the client.
|
|
6
|
-
// Really want the whole thing to be in one file.
|
|
7
|
-
// Possible to have a standard activation?
|
|
8
|
-
//
|
|
9
|
-
// Or we need to have a client-side control?
|
|
10
|
-
//
|
|
11
|
-
// Some of the wiring could be done automatically.
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
var jsgui = require('../server/server');
|
|
15
|
-
var Combo_Box = jsgui.Combo_Box;
|
|
16
|
-
|
|
17
|
-
var Server = jsgui.Server;
|
|
18
|
-
var port = 80;
|
|
19
|
-
var Server_Page_Context = Server.Page_Context;
|
|
20
|
-
|
|
21
|
-
var server = new Server({
|
|
22
|
-
routes: {
|
|
23
|
-
'*': {
|
|
24
|
-
'name': 'html-server'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
var resource_pool = server.resource_pool;
|
|
31
|
-
|
|
32
|
-
// Rendering single page controls makes a lot of sense.
|
|
33
|
-
// It means the activation code can be contained better there.
|
|
34
|
-
|
|
35
|
-
//console.log('resource_pool', resource_pool);
|
|
36
|
-
//console.log('resource_pool.resources', resource_pool.resources);
|
|
37
|
-
|
|
38
|
-
// The start stop toggle button would need to be registered on the client side.
|
|
39
|
-
// May be worth it to have the standard controls registered to start with.
|
|
40
|
-
// Or to have the app know which controls are used, so it can register them.
|
|
41
|
-
|
|
42
|
-
// Get the website resource
|
|
43
|
-
|
|
44
|
-
// Caching items / resources by type?
|
|
45
|
-
// Need to give the resources a name.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//var website = resource_pool.get_resource('Server Router');
|
|
49
|
-
//console.log('\n\n');
|
|
50
|
-
var server_router = resource_pool.get_resource('Server Router');
|
|
51
|
-
|
|
52
|
-
//console.log('server_router', server_router);
|
|
53
|
-
|
|
54
|
-
if (!server_router) {
|
|
55
|
-
throw 'no server_router';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var routing_tree = server_router.routing_tree;
|
|
59
|
-
|
|
60
|
-
routing_tree.set('/', function(req, res) {
|
|
61
|
-
//console.log('root path / request');
|
|
62
|
-
var server_page_context = new Server_Page_Context({
|
|
63
|
-
'req': req,
|
|
64
|
-
'res': res,
|
|
65
|
-
'resource_pool': resource_pool
|
|
66
|
-
});
|
|
67
|
-
// Page_Bounds_Specifier
|
|
68
|
-
var hd = new jsgui.Client_HTML_Document({
|
|
69
|
-
'context': server_page_context
|
|
70
|
-
});
|
|
71
|
-
hd.include_client_css();
|
|
72
|
-
hd.include_js('/js/app-bundle.js');
|
|
73
|
-
var body = hd.body;
|
|
74
|
-
var ctrl = new Combo_Box({
|
|
75
|
-
'context': server_page_context
|
|
76
|
-
});
|
|
77
|
-
//var ctrl2 = new jsgui.Control({});
|
|
78
|
-
body.add(ctrl);
|
|
79
|
-
|
|
80
|
-
// Can change to observable promise that also has log info
|
|
81
|
-
// Will then be easier to peak into log info and show it in a gui as well.
|
|
82
|
-
// Log guids could also be of use with this.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
hd.all_html_render(function(err, deferred_html) {
|
|
87
|
-
if (err) {
|
|
88
|
-
throw err;
|
|
89
|
-
} else {
|
|
90
|
-
//console.log('deferred_html', deferred_html);
|
|
91
|
-
var mime_type = 'text/html';
|
|
92
|
-
//console.log('mime_type ' + mime_type);
|
|
93
|
-
res.writeHead(200, { 'Content-Type': mime_type });
|
|
94
|
-
res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
server.start(port, function(err, cb_start) {
|
|
100
|
-
if (err) {
|
|
101
|
-
throw err;
|
|
102
|
-
} else {
|
|
103
|
-
console.log('master server started');
|
|
104
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Created by James on 02/10/2016.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// This one will need to activate on the client.
|
|
6
|
+
// Really want the whole thing to be in one file.
|
|
7
|
+
// Possible to have a standard activation?
|
|
8
|
+
//
|
|
9
|
+
// Or we need to have a client-side control?
|
|
10
|
+
//
|
|
11
|
+
// Some of the wiring could be done automatically.
|
|
12
|
+
//
|
|
13
|
+
|
|
14
|
+
var jsgui = require('../server/server');
|
|
15
|
+
var Combo_Box = jsgui.Combo_Box;
|
|
16
|
+
|
|
17
|
+
var Server = jsgui.Server;
|
|
18
|
+
var port = 80;
|
|
19
|
+
var Server_Page_Context = Server.Page_Context;
|
|
20
|
+
|
|
21
|
+
var server = new Server({
|
|
22
|
+
routes: {
|
|
23
|
+
'*': {
|
|
24
|
+
'name': 'html-server'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
var resource_pool = server.resource_pool;
|
|
31
|
+
|
|
32
|
+
// Rendering single page controls makes a lot of sense.
|
|
33
|
+
// It means the activation code can be contained better there.
|
|
34
|
+
|
|
35
|
+
//console.log('resource_pool', resource_pool);
|
|
36
|
+
//console.log('resource_pool.resources', resource_pool.resources);
|
|
37
|
+
|
|
38
|
+
// The start stop toggle button would need to be registered on the client side.
|
|
39
|
+
// May be worth it to have the standard controls registered to start with.
|
|
40
|
+
// Or to have the app know which controls are used, so it can register them.
|
|
41
|
+
|
|
42
|
+
// Get the website resource
|
|
43
|
+
|
|
44
|
+
// Caching items / resources by type?
|
|
45
|
+
// Need to give the resources a name.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
//var website = resource_pool.get_resource('Server Router');
|
|
49
|
+
//console.log('\n\n');
|
|
50
|
+
var server_router = resource_pool.get_resource('Server Router');
|
|
51
|
+
|
|
52
|
+
//console.log('server_router', server_router);
|
|
53
|
+
|
|
54
|
+
if (!server_router) {
|
|
55
|
+
throw 'no server_router';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var routing_tree = server_router.routing_tree;
|
|
59
|
+
|
|
60
|
+
routing_tree.set('/', function(req, res) {
|
|
61
|
+
//console.log('root path / request');
|
|
62
|
+
var server_page_context = new Server_Page_Context({
|
|
63
|
+
'req': req,
|
|
64
|
+
'res': res,
|
|
65
|
+
'resource_pool': resource_pool
|
|
66
|
+
});
|
|
67
|
+
// Page_Bounds_Specifier
|
|
68
|
+
var hd = new jsgui.Client_HTML_Document({
|
|
69
|
+
'context': server_page_context
|
|
70
|
+
});
|
|
71
|
+
hd.include_client_css();
|
|
72
|
+
hd.include_js('/js/app-bundle.js');
|
|
73
|
+
var body = hd.body;
|
|
74
|
+
var ctrl = new Combo_Box({
|
|
75
|
+
'context': server_page_context
|
|
76
|
+
});
|
|
77
|
+
//var ctrl2 = new jsgui.Control({});
|
|
78
|
+
body.add(ctrl);
|
|
79
|
+
|
|
80
|
+
// Can change to observable promise that also has log info
|
|
81
|
+
// Will then be easier to peak into log info and show it in a gui as well.
|
|
82
|
+
// Log guids could also be of use with this.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
hd.all_html_render(function(err, deferred_html) {
|
|
87
|
+
if (err) {
|
|
88
|
+
throw err;
|
|
89
|
+
} else {
|
|
90
|
+
//console.log('deferred_html', deferred_html);
|
|
91
|
+
var mime_type = 'text/html';
|
|
92
|
+
//console.log('mime_type ' + mime_type);
|
|
93
|
+
res.writeHead(200, { 'Content-Type': mime_type });
|
|
94
|
+
res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
server.start(port, function(err, cb_start) {
|
|
100
|
+
if (err) {
|
|
101
|
+
throw err;
|
|
102
|
+
} else {
|
|
103
|
+
console.log('master server started');
|
|
104
|
+
}
|
|
105
105
|
});
|