[gitg/wip/techlivezh/diff-view-clean-up: 10/21] Document the usage of each block of code
- From: Techlive Zheng <techlivezh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/techlivezh/diff-view-clean-up: 10/21] Document the usage of each block of code
- Date: Sat, 21 Dec 2013 15:52:05 +0000 (UTC)
commit cd0fd0aaac093ea9490ef26ecbf22ed7760f1c2b
Author: Techlive Zheng <techlivezheng gmail com>
Date: Tue Dec 17 20:38:15 2013 +0800
Document the usage of each block of code
libgitg/resources/diff-view-html-builder.js | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 9c9c341..d8c663a 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -13,6 +13,9 @@ function diff_file(file, lnstate, data)
var added = 0;
var removed = 0;
+ /**
+ * file_body
+ */
var file_body = '';
for (var i = 0; i < file.hunks.length; ++i)
@@ -117,6 +120,9 @@ function diff_file(file, lnstate, data)
}
}
+ /**
+ * file_path
+ */
var file_path;
if (file.file.new.path)
@@ -128,6 +134,9 @@ function diff_file(file, lnstate, data)
file_path = file.file.old.path;
}
+ /**
+ * file_stats
+ */
var total = added + removed;
var addedp = Math.floor(added / total * 100);
var removedp = 100 - addedp;
@@ -152,6 +161,9 @@ function diff_file(file, lnstate, data)
file_stats += '<span class="' + cls + '">' + nm + '</span>';
}
+ /**
+ * run template
+ */
var template = data.file_template;
var repls = {
'FILE_PATH': file_path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]