-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs_ad
1381 lines (1190 loc) · 137 KB
/
docs_ad
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##
-------------------------
Content:
-------------------------
[01] TABLES
[02] PSEUDOCODES
[02] Entering Ad
[03] Save billing changes
[04] perform action - start/stop campaign
[05] Save budget changes
[06] Entering campaign creation guide
[07] adding keywords to table (choosing keywords for new campaing; NOT saving them yet)
[08] save keywords changes
[09] Selecting different keyword in campaign statistics section
[10] Selecting success rate
[11] Editing campaign
[12] using date filter (datepicker plugin)
[13] Finish campaign creation
[14] Delete campaign
[15] Return from billing section after succesful saving of billing info data by clicking 'go to 'shortcut $('#returnFromBillingInfoCompletion')
[16] Focusing/Unfocusing input field
[17] Clicking next/previous results button of top navigation
-------------------------
# --
[ 01 ] [ TABLES ]
[1] adam_campaign
+----------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(35) | YES | UNI | NULL | |
| status | int(11) | YES | | NULL | |
| typeOfCampaign | int(11) | YES | | NULL | |
| budget | double | YES | | NULL | |
| idPerson_id | int(11) | NO | MUL | NULL | |
| idCampaign | varchar(32) | YES | UNI | NULL | |
| timestamp | datetime | NO | | NULL | |
| title | varchar(35) | YES | | NULL | |
| description1 | varchar(70) | YES | | NULL | |
| description2 | varchar(70) | YES | | NULL | |
| url1 | varchar(35) | NO | | NULL | |
| url2 | varchar(1024) | NO | | NULL | |
+----------------+---------------+------+-----+---------+----------------+
[2] adam_bills
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idPerson_id | int(11) | NO | MUL | NULL | |
| status | int(11) | YES | | NULL | |
| period | varchar(10) | YES | | NULL | |
| totalCost | double | YES | | NULL | |
| varSymbol | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
[3] adam_billing
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idPerson_id | int(11) | NO | MUL | NULL | |
| companyName | varchar(128) | NO | | NULL | |
| companyStreet | varchar(128) | YES | | NULL | |
| companyTown | varchar(128) | YES | | NULL | |
| companyZIP | varchar(6) | YES | | NULL | |
| companyPhone | varchar(16) | YES | | NULL | |
| companyEmail | varchar(255) | YES | | NULL | |
| companyIC | int(11) | YES | | NULL | |
| companyDIC | bigint(20) | YES | | NULL | |
+---------------+--------------+------+-----+---------+----------------+
[4] adam_campaignperiods
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| timestamp | datetime | NO | | NULL | |
| flag | int(11) | YES | | NULL | |
+---------------+-------------+------+-----+---------+----------------+
[5] adam_campaignwords
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| idWord_id | varchar(40) | NO | MUL | NULL | |
+---------------+-------------+------+-----+---------+----------------+
[6] adam_campchangeslog
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| numOfOperation | int(11) | YES | | NULL | |
| originalValue | varchar(255) | YES | | NULL | |
| timestamp | datetime | NO | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
[7]adam_camplog
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| numOfOperation | int(11) | YES | | NULL | |
| originalValue | varchar(255) | YES | | NULL | |
| timestamp | datetime | NO | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
[8]adam_campwordschangeslog
+----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| numOfOperation | int(11) | YES | | NULL | |
| idWord_id | varchar(40) | NO | MUL | NULL | |
| timestamp | datetime | NO | | NULL | |
+----------------+-------------+------+-----+---------+----------------+
[9] adam_cpcs
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| avgCPC | double | YES | | NULL | |
| date | date | NO | | NULL | |
+---------------+-------------+------+-----+---------+----------------+
[10] adam_deletedcampaigns
+---------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(35) | NO | | NULL | |
| typeOfCampaign | int(11) | NO | | NULL | |
| budget | double | NO | | NULL | |
| idPerson_id | int(11) | NO | MUL | NULL | |
| idCampaign | varchar(32) | NO | | NULL | |
| timestampOfCreation | datetime | NO | | NULL | |
| timestampOfDeletion | datetime | NO | | NULL | |
| title | varchar(35) | NO | | NULL | |
| description1 | varchar(35) | NO | | NULL | |
| description2 | varchar(35) | NO | | NULL | |
| url1 | varchar(35) | NO | | NULL | |
| url2 | varchar(1024) | NO | | NULL | |
+---------------------+---------------+------+-----+---------+----------------+
[11]adam_deletedcampaignwords
+---------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign | varchar(32) | YES | | NULL | |
| idWord_id | varchar(40) | NO | MUL | NULL | |
| timestampOfDeletion | datetime | NO | | NULL | |
+---------------------+-------------+------+-----+---------+----------------+
[12]adam_statistics;
+---------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idWord_id | varchar(40) | NO | MUL | NULL | |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| date | date | NO | | NULL | |
| countOfClicks | int(11) | YES | | NULL | |
| countOfViews | int(11) | YES | | NULL | |
| uniqueCountOfClicks | int(11) | YES | | NULL | |
| uniqueCountOfViews | int(11) | YES | | NULL | |
+---------------------+-------------+------+-----+---------+----------------+
[13]adam_clickinfo
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| ip | char(15) | YES | | NULL | |
| date | date | NO | | NULL | |
+---------------+-------------+------+-----+---------+----------------+
[14] adam_viewinfo
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idCampaign_id | varchar(32) | NO | MUL | NULL | |
| ip | char(15) | YES | | NULL | |
| date | date | NO | | NULL | |
+---------------+-------------+------+-----+---------+----------------+
[15] adam_words
+--------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idWord | varchar(40) | NO | UNI | NULL | |
| name | varchar(255) | NO | UNI | NULL | |
| CPM | double | NO | | NULL | |
| CPC | double | NO | | NULL | |
+--------+--------------+------+-----+---------+----------------+
[16] adam_log
+----------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| idPerson_id | int(11) | YES | MUL | NULL | |
| idCampaign | varchar(32) | YES | | NULL | |
| numOfOperation | int(11) | YES | | NULL | |
| name | varchar(35) | YES | | NULL | |
| timestamp | datetime | NO | | NULL | |
+----------------+-------------+------+-----+---------+----------------+
[ 02 ] Pseudocodes
[1] ad building
[2] $.fn.checkBillingInfoIsComplete
[3] save_billing_info
[4] give_me_price
[5] $.fn.addWordButHandler ajax success
[6] save_keywords_changes
[7] $.fn.addSaveKeywordsHandler ajax success
[8] show_statistics
[9] select success rate
[10] datepick statistics or CPCs data
[11] create_campaign
[12] $.fn.addFinishCampaignCreationHandler ajax success
[13] $.fn.addDeleteCampaignHandler ajax success
[14] $.fn.checkField
[ 02 ] [ Entering Ad ]
# --
DAT_FILES = '', ''
DB_TABLES = [1],[2],[3]
Pseudocodes = [1],[2]
Source Files (SF)
------------------------------------------------------------------------------------------------------------
| ID | Path |
------------------------------------------------------------------------------------------------------------
|[1] | 'wordblog/adam/templates/ad.html' |
|[2] | 'wordblog/adam/views.py' |
|[3] | 'wordblog/adam/static/buildAd.js' |
|[4] | 'wordblog/adam/static/bills.js' |
|[5] | 'wordblog/adam/static/billing.js' |
|[6] | 'wordblog/adam/static/guide.js' |
|[7] | 'wordblog/adam/static/campaigns.js' |
|[8] | 'wordblog/adam/static/common.js' |
|[9] | 'wordblog/adam/static/commonAdAdmin.js' |
------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | SF | Params | RetVal
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | ad | [2] | request | 'ad.html' {campaign,billingInfoId,billingInfoDic,isBillingInfo,bills}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.buildAd | [3] | bills,campaigns,billingInfoDic,billingInfoId | <none>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.buildBills | [4] | data,flag | <none>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.buildBillsRow | [4] | ids,status,period,total,flag | bill row html string
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.builBilling | [5] | billingInfoDic,billingInfoId | <none>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.addBillingInfoFieldsHandler | [5] | billingInfoDic | <none>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.buildGuide | [6] | sumOfCampaigns | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | $.fn.addSwitchMenuHandler | [3] | <none> | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | $.fn.addBackArrowHandler | [9] | <none> | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | $.fn.checkBillingInfoIsComplete | [3] | <none> | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | $.fn.buildCampaigns | [7] | campaigns | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | $.fn.buildCampaign | [7] | idCampaign,name,status,successRate,timePeriod | campaign row html string
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | $.fn.buildLoggedUser | [8] | data | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | $.fn.centerDiv | [8] | <none> | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | getting data from tables: [1] , [2] , [3] and rendering template 'ad.html'
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | Building Ad according to the data from view method 'ad'
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | Building bills section
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | Building one bill row
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | Building Billing section
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | Adding focusing/unfocusing handlers to each billing field; sets value of each field when param billingInfoDic != 0
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | Building campaign creation guide section
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | Switches Ad content parts by clicking options in top header
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | Adds return functionality to the back arrow
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | Checks whether billing data are filled, if not user is asked to fill them first before he starts campaign creation
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | Building campaigns section
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | Building one campaign row
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | Builds logged user UI profile;contains $("#adForm") [13]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | centers ad interface
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1) When user enters Ad module,request is sent to url '/app/adam/ad/' via form adForm $("#adForm") [13]; the url request is then resolved to view method ad;
2) on the basis of userID retrieved from request, "ad" gets data from tables: [1] , [2] , [3] and sends them to rendered template 'ad.html'
3) According to the data , on the client side there begins building of Ad composed of 4 main sections - bills,campaigns,billing,guide;
pseudocodes [1]
4) [3]:
pseudocodes [2]
[ 03 ] Save billing changes
DB_TABLES = '[3]'
Pseudocodes = [3]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/views.py'
|[2] 'wordblog/adam/static/saveBillingChanges.js'
|[3] 'wordblog/adam/static/checkField.js'
|[4] 'wordblog/adam/static/billing.js'
------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | save_billing_info | [1] | request(form:billingInfoId) | 0 || 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addSaveBillingInfoHandler | [2] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.checkBillingInfo | [2] | <none> | 0 || 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.checkField | [3] | selector,num,errDiv | 1 || 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.builBilling | [4] | billingInfoDic,billingInfoId | <none>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | saves billing data to table [3]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches ajax click handler (action = '/app/adam/saveBillingInfo/') to saveBillingInfoButton ([5])
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | checks validity of the data inserted/typed into billing section input fields
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | checks validity of the data typed/inserted into input field
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | Building Billing section
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1) when user clicks saveBillingInfoButton [5], ajax POST request is sent to url '/app/adam/saveBillingInfo/' via form saveBillingInfoForm [4] which contains billingInfoId, the url request is then resolved to DJ view method save_billing_info
2) [1]:
pseudocodes [3]
[04] perform action - start/stop campaign
DB_TABLES = '[1],[4],[5]'
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/views.py'
|[2] 'wordblog/adam/static/performAction.js'
|[3] 'wordblog/adam/static/campaigns.js'
------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source File | Params | RetVal |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | campaign_action | [1] | request(form:idCampaign) | JSON(campaignStatus,idCampaign,timePeriod) |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addActionButtonHandler | [2] | flag | <none> |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | JS: $.fn.buildCampaign | [3] | idCampaign,name,status,successRate,timePeriod | campaign row html string |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | Changes the campaign status; saves log data to table [5]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | Attaches ajax handler(action = '/app/adam/campaignAction/' ) to all actionButtons
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | Builds one campaign row; contains actionButton $(div[class="actionButton"]) and $('#campaignActionForm"+idCampaign+"')
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. when user clicks actionButton ,ajax POST request is sent to url '/app/adam/campaignAction/' via form campaignActionForm [3] which contains idCampaign, the url request is then resolved to DJ view method [1]
2. [1] changes status of the campaign in the table[1];
saves idCampaign,timestamp,numOfOperation,original value to table [5];
saves idCampaign, timestamp, flag to table [4];
returns JSON { changed campaignStatus , idCampaign, timePeriod (sum of days the campaign was active)}
[05] Save budget changes
DB_TABLES = '[1],[6]'
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/views.py'
|[2] 'wordblog/adam/static/saveBudgetChanges.js'
|[3] 'wordblog/adam/static/budget.js'
------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source File | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | save_budget_changes | [1] | request(form:idCampaign,budget) | 0 || 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addSaveBudgetHandler | [2] | idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.buildBudget | [3] | idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | edits budget of the user; saves log data to table [6];
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches ajax handler(action = '/app/adam/saveBudgetChanges/' to saveBudget button
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | builds campaign 'budget' section; contains saveBudgetChangesForm ($('#saveBudgetChangesForm"+idCampaign+"'))
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. when user clicks saveBudgetButton($('#saveBudget')[3]),ajax POST request is sent to url '/app/adam/saveBudgetChanges/' via form saveBudgetChangesForm, which contains idCampaign and the new budget value;the url request is then resolved to DJ view method [1]
2. [1] saves the new budget value by editing Campaign object of the user - changing campaign budget value in the table [1];
saves idCampaign,timestamp,numOfOperation,original value to the table [6];
[06] Entering campaign creation guide
DB_TABLES = ''
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/guide.js'
|[2] 'wordblog/adam/static/fillCampaignContent.js'
|[3] 'wordblog/adam/static/checkStep.js'
|[4] 'wordblog/adam/static/checkField.js'
|[5] 'wordblog/adam/static/campaigns.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source File | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | $.fn.buildGuide | [1] | sumOfCampaigns | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addNextStepHandler | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.addPreviousStepHandler | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.addTopNavigation | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.addStartCampaignCreationHandler | [1] | sumOfCampaigns | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.addReturnFromGuideHandler | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.returnToCampaignList | [1] | flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | $.fn.deleteSteps | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | $.fn.insertInputFieldValues | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | $.fn.buildStep1 | [1] | sumOfCampaigns | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | $.fn.buildStep4 | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | $.fn.checkNavButtons | [1] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | $.fn.checkStepButtons | [1] | <none> | <none>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | $.fn.changeOpacityOnSelected | [1] | selector | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 15 | $.fn.fillCampaignContent | [2] | areaDescription,areaKeyword,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 16 | $.fn.checkStep | [3] | <none> | 1 || 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 17 | $.fn.checkField | [4] | selector,num,errDiv | 1 || 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 18 | $.fn.buildCampaigns | [5] | campaigns | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | builds campaign creation guide section (adds guide content to $('#menuGuide'))
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches click handler to the $('#nextStep') [1] for going to the next step
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | attaches click handler to the $('#prevStep') [1] for going to the previous step
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | adds switch steps functionality to the guide top navigation $("div[class='steps']") [1]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | calls building methods of all of the guide steps
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | attaches click handler to returnToMenuButton $('#returnToMenuButton') [1] for returning to campaigns section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | hides campaigns section ($('#menuCampaigns')), shows guide section ($('#menuGuide')) or vice versa
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | deletes content of all the guide steps( $('#step1'),$('#step2'),$('#step3'),$('#step4'))
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | adds input field values (or keywords) from step 1-3 to the summary table of the 4. guide step $('#finish') [1] (or $('#chosenWordsFinish') [1])
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | builds step1 ( for filling campaign budget and name)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | builds step4 ( for generating campaign resume )
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | decides whether the next/previous step button, returnToMenuButton, finishCampaignCreationButton should be visible or hidden when switching the steps
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | wrapper;sends selector as param to [14]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | changes opacity and cursor of buttons in top guide navigations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 15 | builds step2 (filling campaign description step) and step3 (choosing keywords step);contains ajax handler
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 16 | checks validity of the data inserted into input fields of the current step
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 17 | checks validity of the data in the input field
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 18 | builds campaigns section
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.when user clicks createCampaignButton in campaigns section [18], there begins building of the campaign creation guide section [1] ;the guide content is added to $('#menuGuide')):
[1] calls building methods of all 4 steps:
step1 is built by [10];
step4 is built by [11];
step2 and step3 are built by [15];
[2] is attached for going to the next step; if the user clicks the nextStepButton, [16] is called to check validity of the data inserted into input fields of the given step
[07] adding keywords to table (choosing keywords for new campaing; NOT saving them yet)
DB_TABLES = '[15]'
Pseudocodes = [4],[5]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/views.js'
|[2] 'wordblog/adam/static/addKeywords.js'
|[3] 'wordblog/adam/static/commonAdAdmin.js'
|[4] 'wordblog/adam/static/keyword.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source File | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | give_me_price | [1] | request(form:string) | JSON dic
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addWordButHandler | [2] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.checkKeywordDuplicity | [3] | value | 1 || 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.sortKeywords | [2] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.buildKeyword | [4] | id,name,cpm,cpc,flag,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.addBuildKeywordHandler | [2] | id,name,cpm,cpc,flag,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.buildEditCampaignKeyword | [4] | areaKeyword,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | Searches the word string in the table [15]; if the word exists gets CPM and PPC of the word, orherwise tries to give suggestion
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches ajax click handler to addWordBut [5] ;if the word exists in table[15]: builds keyword record into $('#chosenWords') table [7] ,otherwise gives suggestion or warning
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | checks whether the input field word string is in chosen keywords table
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | sorts keywords alphabetically in chosen keywords table
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | builds keyword record into chosen keywords table
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | wrapper of [5]; builds keyword record into chosen keywords table in case user clicks the suggestion
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | builds keyword section;contains pricing form
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.after the user finishes typing keyword into input field and clicks addWordBut ($('#addWordBut') [5]), there begins checking if the keyword is already in chosen keywords table ($('#chosenWords') [7] by [3], if not ajax POST request is sent to url '/app/adam/giveMePrice/' via form 'pricingForm' [7]; pricing form contains the user word string;
the url request is then resolved to DJ view method [1]
2. pseudocodes [4]
3.
pseudocodes [5]
[08] save keywords changes
DB_TABLES = '[5],[8],[11]'
Pseudocodes = [6],[7]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/views.js'
|[2] 'wordblog/adam/static/saveKeywordsChanges.js'
|[3] 'wordblog/adam/static/keyword.js'
|[4] 'wordblog/adam/static/over.js'
|[5] 'wordblog/adam/static/stat.js'
|[6] 'wordblog/adam/static/getResults.js'
|[7] 'wordblog/adam/static/navigation.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | SF | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | save_keywords_changes | [1] | request(form:idCampaign,keywordIDs) | JSON dic
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addSaveKeywordsHandler | [2] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.deleteFromDefaultList | [2] | idWord | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.buildEditCampaignKeyword | [3] | areaKeyword,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.buildOverTable | [4] | flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.buildEditCampaignStat | [5] | idCampaign,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.resetOver | [4] | len,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | $.fn.getResults | [6] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | $.fn.checkNavigationPanelVisibility | [7] | len,add1,str | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | $.fn.checkPagesNavigators | [7] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | $.fn.buildEditCampaignOver | [4] | idCampaing | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | $.fn.buildNavigationPanel | [7] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | saves or deletes keywords (table[5]);deleted words are stored into table[11]; saves log data to table [8]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches click ajax handler(action = '/app/adam/saveKeywordsChanges/' to saveKeywordsButton $('#saveKeywords') [4] to save keywords changes
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | deletes word from $.gen.defaultListOver (list where camp. keywords are stored by default order ) and $.gen.dicOver (dic where camp. keywords are stored by the camp. keywords success rates )
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | builds keyword section;contains saveKeywordsChangesForm $('#saveKeywordsChangesForm')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | builds 'over' $('#over') table
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | builds 'stat' (Statistics) section;contains selectKeyword $('#selectKeywordTable') for selecting campaignWord to show the statistics
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | resets counts in top navigation panel [12] of campaign 'over' section [11]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | gets batch of results declared in counts of top navigation panel
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | hides/shows campaing 'over' section navigationPanel
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | styles left arrow and right arrow in navigation panel of campaign 'over' section to reflect whether there are any next/previous batch of results or not
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | builds campaign 'over' (overview) section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | builds a section top navigation panel
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.when user clicks saveKeywordsButton,ajax POST request is sent to url '/app/adam/saveKeywordsChanges/' via form saveKeywordsChangesForm, that contains idCampaign and keywordIDs (IDs of all the words in chosen words table [4];the url request is then resolved to DJ view method [1]
2.pseudocodes [6]
3.pseudocodes [7]
[8]: for example if top navigation panel shows results 1 to 5 of 10, [5] will display first 5 results
[9]: is called to decide whether there are more results than is the limit for the number of displayed results at the same time, if so campaign 'over' section navigationPanel is shown,
otherwise campaign 'over' section navigationPanel is hidden
[09] Selecting different keyword in campaign statistics section
DB_TABLES = '[12]'
Pseudocodes = [8]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/views.js'
|[2] 'wordblog/adam/static/selectKeyword.js'
|[3] 'wordblog/adam/static/stat.js'
|[4] 'wordblog/adam/static/dateFilter.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | SF | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | show_statistics | [1] | request(form:idWord,idCampaign) | JSON dic
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addSelectKeywordHandler | [2] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.buildEditCampaignStat | [3] | idCampaign,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | reset_stat | [3] | len | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.buildStatSet | [2] | data | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.insertPeriods | [4] | flag,extent | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.buildStatRecord | [3] | date,views,clicks,successRate | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | $.fn.buildFilterTable | [4] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | gets statistics data from table [12] for the selected idWord and idCampaign
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | attaches 'on change' ajax handler(action = '/app/adam/showStatistics/') to the campaign statistics section select tag $('#selectKeyword') [3] to get statistics data for the selected keyword
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | builds campaign statistics section('stat');contains the select tag $('#selectKeyword') and showStatisticsForm $('#showStatisticsForm')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | resets counts in top navigation panel of campaign statistics section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | saves statistics records to $.gen.dicStat (dictionary;key = successRate) and to $.gen.defListStat (list;default order - by date); builds first 15 statistics records into 'stat' table [3]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | inserts first and the 15th date into date filter input field [8]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | inserts table row into 'stat' table [3]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | builds date filter input fields
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.when user invokes 'on change' event by selecting different keyword option than default in $('#selectKeyword') [3] ,ajax POST request is sent to url '/app/adam/showStatistics/' via form showStatisticsForm $('#showStatisticsForm') [3], that contains idCampaign and idWord ;the url request is then resolved to DJ view method [1];
2.[1] - gets all records from the table [12] for the given idCampaign and selected idWord ordered by date from newest to oldest:
pseudocodes [8]
[10] Selecting success rate
DB_TABLES = ''
Pseudocodes = [9]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/succRate.js'
|[2] 'wordblog/adam/static/selectSuccRate.js'
|[3] 'wordblog/adam/static/getResults.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | Source File | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | $.fn.addSelectSuccRateHandler | [2] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.getResults | [3] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.buildSuccRateTh | [2] | sufix,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | adds 'on change' event listener to $('select[class="selectSuccRate"]') [2]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | gets first batch of results for the given option in $('select[class="selectSuccRate"]')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | builds $('select[class="selectSuccRate"]')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.when user invokes select success rate 'on change' event in $('select[class="selectSuccRate"]') , [2] will get first batch of results for the given option;
pseudocodes [9]
[11] Editing campaign
DB_TABLES = '[1],[5],[9],[12],[15]'
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/editCampaign.js'
|[2] 'wordblog/adam/static/fillCampaignContent.js'
|[3] 'wordblog/adam/static/fillCampaignDetail.js'
|[4] 'wordblog/adam/static/commonAdAdmin.js'
|[5] 'wordblog/adam/static/description.js'
|[6] 'wordblog/adam/static/keyword.js'
|[7] 'wordblog/adam/static/over.js'
|[8] 'wordblog/adam/static/budget.js'
|[9] 'wordblog/adam/static/stat.js'
|[10] 'wordblog/adam/static/CPCs.js'
|[11] 'wordblog/adam/static/preview.js'
|[12] 'wordblog/adam/static/campContentForm.js'
|[13] 'wordblog/adam/static/views.py'
|[14] 'wordblog/adam/static/dateFilter.js'
|[15] 'wordblog/adam/static/navigation.js'
|[16] 'wordblog/adam/static/campaigns.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | SF | Params | RetVal
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | fill_campaign_content | [13] | request(params:idCampaign,flag) | JSON dic
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | $.fn.addEditCampaignHandler | [1] | idCampaign,name | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | $.fn.fillCampaignContent | [2] | areaDescription,areaKeyword,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | $.fn.fillCampaignDetail | [3] | data,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | $.fn.enableBut | [4] | string,button | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | $.fn.addHelperHandler | [4] | <none> | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | $.fn.buildEditCampaignDescription | [5] | areaDescription,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | $.fn.buildEditCampaignKeyword | [6] | areaKeyword,idCampaign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | $.fn.buildEditCampaignStat | [9] | idCampaign,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | $.fn.buildEditCampaignCPCs | [10] | idCampaign,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | $.fn.buildEditCampaignOver | [7] | idCampaing | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | $.fn.buildPreviewTable | [11] | flag,dataFields,isDefault,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | $.fn.makePreview | [11] | typeOfCampaign,dataFields,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | $.fn.changePreview | [11] | value | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 15 | $.fn.buildFillCampaignForm | [12] | idCampaign,flag | str
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 16 | $.fn.resetOver | [7] | len,flag | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 17 | $.fn.resetStat | [9] | len | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 18 | $.fn.resetCPCs | [10] | len | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 19 | $.fn.buildStatSet | [9] | data | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 20 | $.fn.buildCPCsSet | [10] | data | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 21 | $.fn.insertPeriods | [14] | flag,extent | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 22 | $.fn.checkNavigationPanelVisibility | [15] | len,add1,str | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 23 | $.fn.buildKeyword | [6] | id,name,cpm,cpc,flag,sign | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 24 | $.fn.buildOverRecord | [7] | idWord,name,sumOfViews,sumOfClicks,successRate | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 25 | $.fn.buildCampaign | [16] | idCampaign,name,status,successRate,timePeriod | campaign row html string
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 26 | $.fn.buildEditCampaignBudget | [16] | idCampaign | <none>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 27 | $.fn.buildNavigationPanel | [15] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 28 | $.fn.buildFilterTable | [14] | num | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 29 | $.fn.insertDescriptionData | [5] | data | <none>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Use
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 1 | gets data from DB for the given campaign
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2 | adds click handler to editCampaignButton $('#editCampaign') [25] for entering/building selected campaign
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 3 | builds all sections of the edited campaign; sends ajax request to get the edited campaign data;handles the description data for the campaign 'description' section [7]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 4 | inserts all the data (except 'description' data) returned from DJ into the campaign sections (except description section)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 5 | enables saveDescriptionChanges [7] saveBudgetChanges button [26] when starting typing into the input field
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 6 | adds hover event listener to the info icon ($('span[class="topBarInto"]'); $('#helper'+value+'') is shown after user invokes the hovering event
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 7 | builds campaign 'description' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 8 | builds campaign (add) 'keyword' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 9 | builds campaign 'stat' (statistics) section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 10 | builds campaign 'CPCs' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 11 | builds campaign 'over' (overview) section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 12 | builds adType preview for the given data
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 13 | wrapper;calls [12] to build adType preview for the given campaign type and data
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 14 | ensures the appropriate adType preview is visible
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 15 | builds fillCampaignContentForm
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 16 | resets counts in top navigation panel [27] of campaign 'over' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 17 | resets counts in top navigation panel of campaign 'stat' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 18 | resets counts in top navigation panel of campaign 'CPCs' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 19 | saves data to $.gen.dicStat and to $.gen.defListStat; builds first 15 statistics records into 'stat' table in campaign 'statistics' section [9]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 20 | saves data to $.gen.dicCPCs and to $.gen.defListCPCs; builds first 15 statistics records into 'cpcs' table in campaign 'CPCs' section [10]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 21 | inserts first and the 15th date into date filter input field [28]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 22 | hides/shows appropriate campaing section navigationPanel
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 23 | builds keyword record into chosen keywords table ($('#chosenWords') [8]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 24 | inserts table row into 'over' table in campaign 'over' (overview) section [11]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 25 | Builds one campaign row;contains $('#editCampaign')
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 26 | builds campaign 'budget' section
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 27 | builds a section top navigation panel
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 28 | builds date filter input fields
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 29 | inserts description data into $('#descriptionTable') of campaign 'details' section
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.when the user clicks editCampaignButton $('#editCampaign') [25],[3] is called that a) builds campaign sections ('keyword'[8],'stat'[9],'CPCs'[10],'budget'[26],'over'[11])
b) sends ajax POST request to url '/app/adam/fillCampaignContent/'
via form $('#fillCampaignContentForm') [15] which contains IdCampaign and flag
2.[1] a) gets description data for the given idCampaign from table [1],Statistics data (table [12]), CPCs data (table [9]), campaignWords data (table [5]), prices of the given
campaign words from table [15]
b) gets periods extents - first and 15th date of the given data set ('Stat'- wordsPeriodsExtent,'CPCs' - cpcsPeriodsExtent),
c) returns JSON dic
3.[3] a) description data are inserted into campaign 'description' section input fields [7] by [29]
b) adType preview is built into campaign 'description' section by [13] (wrapper);
([12] does the actual building)
[12] using date filter (datepicker plugin)
DB_TABLES = '[9],[12]'
pseudocodes = [10]
------------------------------------------------------------------------------------------------------------
| Source Files |
------------------------------------------------------------------------------------------------------------
|[1] 'wordblog/adam/static/views.js'
|[2] 'wordblog/adam/static/dateFilter.js'
|[3] 'wordblog/adam/static/datepick.js'
|[4] 'wordblog/adam/static/stat.js'
|[5] 'wordblog/adam/static/CPCs.js'
|[6] 'wordblog/adam/static/navigation.js'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Function | SF | Params | RetVal