/diff_action
action rendering the differences between the original skin and the modified one

Sourcecode in Skin/actions.js:
1:   function diff_action() {
2:      // get the modified and original skins
3:      var originalSkin = this.layout.skins.getOriginalSkinSource(this.proto, this.name);
4:   
5:      if (originalSkin == null) {
6:         res.data.status = getMessage("Skin.diff.noDiffAvailable");
7:      } else {
8:         var diff = originalSkin.diff(this.skin ? this.skin : "");
9:         if (!diff) {
10:           res.data.status = getMessage("Skin.diff.noDiffFound");
11:        } else {
12:           res.push();
13:           var sp = new Object();
14:           for (var i in diff) {
15:              var line = diff[i];
16:              sp.num = line.num;
17:              if (line.deleted) {
18:                 sp.status = "DEL";
19:                 sp["class"] = "removed";
20:                 for (var j=0;j<line.deleted.length;j++) {
21:                    sp.num = line.num + j;
22:                    sp.line = encode(line.deleted[j]);
23:                    this.renderSkin("diffline", sp);
24:                 }
25:              }
26:              if (line.inserted) {
27:                 sp.status = "ADD";
28:                 sp["class"] = "added";
29:                 for (var j=0;j<line.inserted.length;j++) {
30:                    sp.num = line.num + j;
31:                    sp.line = encode(line.inserted[j]);
32:                    this.renderSkin("diffline", sp);
33:                 }
34:              }
35:              if (line.value != null) {
36:                 sp.status = "&nbsp;";
37:                 sp["class"] = "line";
38:                 sp.line = encode(line.value);
39:                 this.renderSkin("diffline", sp);
40:              }
41:           }
42:           res.data.diff = res.pop();
43:        }
44:     }
45:     res.data.body = this.renderSkinAsString("diff");
46:     res.data.title = getMessage("Skin.diff.displayTitle", {skinProto: this.proto, skinName: this.name, layoutTitle: this.layout.title});
47:     this.layout.skins.renderSkin("page");
48:     return;
49:  }