-
Notifications
You must be signed in to change notification settings - Fork 0
/
memo.txt
103 lines (49 loc) · 3.61 KB
/
memo.txt
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
CHANGES TO MAKE FOR EACH CLIENT WHEN TAKING CHANGES FROM MASTER:
i. prints.html - search for master
ii. on set up of each new client install @types - see below
iii. PayPal - remove sandbox
TODO
back button not supported because we lose all the data from the models. (it still shows in form cos of browser retnetion)
use the PayPal notify handler
fix DB to have a clients col
validation
accordion panel control
del starts at 50p because we init first order model
make order data readable
paypal is now putting up a delivery address capture - but i am handling that. there must be a way to stop this. (effects JWP and POS as well)
handle case of ajax call to secure order takes forever.
make the client name a variable so i don't have to change it every time (which will be impossible when there are multiple clients)
prints.html
PayPal - for countries with a state add the state field.
https://developer.paypal.com/docs/classic/api/state_codes/ right now not sure what will happen? break or just ask user to complete address?
move pricing to prints.html to keep all customisations in one file
rewrite it - use Angular
Notes on typescript etc
1) Using with jQuery
I had to get both jquery and the ts definition file for jquery. See package.json actaully i'm not sure i need jQuery itself? NO - i've removed it. not required.
try removing it
Then in my project ts file: /// <reference path="node_modules/@types/jquery/index.d.ts" />
What i've done here is: get a definiton file and the lib so that the ts compiler knows what i mean by jquery. The reference command includes the definition file.
https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html
what commands did i run to get the type libs for jquery, backbone and underscore?
could just run npm install on those packages ????
npm install --save-dev @types/jquery @2.0.43 not sure about the version then look in the package json files for the exact version ...
npm install --save-dev @types/[email protected]
npm install --save-dev @types/jquery
@types/underscore@* - this was installed by backbone
Nb. i tried another approach based on importing jquery but then my final js file had:
use strict
exports.es5 = true
or something like that and this broke in the browser because exports is not declared.
this is because i am not using import correctly - maybe because of issues with my jquery lib not properly exporting? or do i need a start file to set up exports?
import / require look like npm commands (at least require)
so what i am not doing here is building the complete project into one file on the command line including backbone, bootstrap js etc etc
and having them all pass through the ts compiler? is that what i want? how does this work with Angular? do you get angular in a ts version?
does the ts compliler act like webpack and manage your dependencies into one file?
on modules see:
https://auth0.com/blog/javascript-module-systems-showdown/
https://www.typescriptlang.org/docs/handbook/modules.html
in other words: i'm loading the dependencies in the browser and then using type definitions to inform the ts compiler about them to it doesn't break
but i'm not loading the whole project server side - how would i do this?
Ts has a module loader system - but assume that it expects the modules to be in ts ? (could you use it to load non ts modules and supply the defintion files?)
webpack and grunt? could you build all your modules using webpack inc. ts ones and js ones and then as a grunt task run them through the ts compiler? (again i think you'd need definition files?)