OSDN Git Service

js: fix editor related code to make more readable
[newslash/newslash.git] / src / newslash_web / public / js / base.js
1 /* base.js - some base classes for newslash frontend */
2
3 var Content = function(contentType) {
4   // Common
5   this.uid = 0;
6   this.create_time = "";
7   this.title = "";
8   this.intro_text = "";
9
10   this.author = "anonymous coward";
11   this.content_type = contentType;
12
13   // Journal
14   if (contentType == "journal") {
15     this.id = 0;
16   }
17   
18   // Story
19   if (contentType == "story") {
20     this.stoid = 0;
21     this.sid = 0;
22     this.dept = "";
23     this.body_text = "";
24     this.add_related = "";
25     this.url = "";
26     this.mediaurl = "";
27     this.mediatype = "";
28     this.email = "";
29     this.commentstatus = "enabled";
30     this.display = 1;
31     this.submissioncopy = 0;
32     this.submission_id = 0;
33   }
34
35   // for internal use
36   this.tagsString = "";
37   this.related = "";
38   this.editing = true;
39 };
40
41
42 // Comments
43 var Comment = function () {
44   this.sid = 0;
45   this.cid = 0;
46   this.pid = 0;
47   this.date = '';
48   this.last_update = '';
49   this.subject = '';
50   this.uid = 0;
51   this.points = 0;
52   this.points_orig = 0;
53   this.points_max = 0;
54   this.lastmod = 0;
55   this.reason = 0;
56   this.signature = '';
57   this.len = 0;
58   this.karma_bonus = 'no';
59   this.karma = 0;
60   this.karma_abs = 0;
61   this.tweak_orig = 0;
62   this.tweak = 0;
63   this.badge_id = 0;
64   this.comment = '';
65   this.create_time = '';
66   this.author = '';
67   this.children = [];
68 };
69