[Notice] Announcing the End of Demo Server [Read me]

fix code browser
@8e795983127057b13f4bd988b77b0fbc6a5d740c
--- public/javascripts/service/hive.code.Browser.js
+++ public/javascripts/service/hive.code.Browser.js
... | ... | @@ -41,6 +41,7 @@ |
41 | 41 |
*/ |
42 | 42 |
function _initVar(htOptions){ |
43 | 43 |
htVar.rxHash = /^#/; |
44 |
+ htVar.rxTmp = /\!\//; |
|
44 | 45 |
htVar.sProjectName = htOptions.sProjectName; |
45 | 46 |
htVar.sTplFileListItem = $("#tplFileListItem").html() || ""; |
46 | 47 |
} |
... | ... | @@ -92,16 +93,18 @@ |
92 | 93 |
*/ |
93 | 94 |
function _onSelectBranch(){ |
94 | 95 |
htElement.welSelectedBranch.text($(this).text()); |
95 |
- $(window).trigger("hashchange"); |
|
96 |
+ $(window).trigger("hashchange"); |
|
96 | 97 |
} |
97 | 98 |
|
98 | 99 |
/** |
99 | 100 |
* on hash change |
100 | 101 |
*/ |
101 | 102 |
function _onHashChange(){ |
102 |
- var sPath = getHash().replace(htVar.rxHash, ""); |
|
103 |
+ var sPath = getHash(true);//.replace(htVar.rxTmp, "!#/"); |
|
103 | 104 |
var sBranch = window.encodeURIComponent(htElement.welSelectedBranch.text()); |
104 | 105 |
var sURL = "code/" + sBranch + "/!" + sPath; |
106 |
+ sURL = sURL.replace(/\!\!/, '!#'); |
|
107 |
+ console.log("hashchange", sURL); |
|
105 | 108 |
|
106 | 109 |
$.ajax(sURL, { |
107 | 110 |
"datatype": "json", |
... | ... | @@ -115,6 +118,7 @@ |
115 | 118 |
* callback function of _onHashChange |
116 | 119 |
*/ |
117 | 120 |
function _onLoadListCode(oRes){ |
121 |
+ console.log("onload"); |
|
118 | 122 |
_updateFileInfo(oRes); |
119 | 123 |
|
120 | 124 |
switch(oRes.type){ |
... | ... | @@ -153,13 +157,14 @@ |
153 | 157 |
var aTplData = []; |
154 | 158 |
|
155 | 159 |
// 템플릿용 데이터로 가공해서 배열에 추가 |
156 |
- var sPath = getHash().replace(htVar.rxHash, ""); |
|
160 |
+ var sPath = (getHash(true) || ""); |
|
157 | 161 |
var aData = _sortFolderList(htData.data); |
162 |
+ |
|
158 | 163 |
aData.forEach(function(htTmp){ |
159 | 164 |
htTmp.name = htTmp.title; |
160 | 165 |
htTmp.dateAgo = getDateAgo(htTmp.date); |
161 | 166 |
htTmp.message = getEllipsis(htTmp.message, 70); |
162 |
- htTmp.filePath = "#" + sPath + "/" + htTmp.name; |
|
167 |
+ htTmp.filePath = "#" + (sPath !== "/" ? sPath : "") + "/" + htTmp.name; |
|
163 | 168 |
aTplData.push(htTmp); |
164 | 169 |
}); |
165 | 170 |
|
... | ... | @@ -503,4 +508,4 @@ |
503 | 508 |
_init(htOptions || {}); |
504 | 509 |
}; |
505 | 510 |
|
506 |
-})("hive.code.Browser");(No newline at end of file) |
|
511 |
+})("hive.CodeBrowser");(No newline at end of file) |
--- public/javascripts/service/hive.code.Browser1.js
+++ public/javascripts/service/hive.code.Browser1.js
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
|
17 | 17 |
$(document).ready(function(){ |
18 | 18 |
$(window).bind('hashchange', function(e){ |
19 |
- _updateDynaTree(); |
|
19 |
+// _updateDynaTree(); |
|
20 | 20 |
|
21 | 21 |
//대기 표시 한다. |
22 | 22 |
//여기서 요청을 보내고 |
... | ... | @@ -169,6 +169,7 @@ |
169 | 169 |
$("#selected-branch").text('HEAD'); |
170 | 170 |
} |
171 | 171 |
$(window).trigger('hashchange'); |
172 |
+ _updateDynaTree(); |
|
172 | 173 |
}); |
173 | 174 |
|
174 | 175 |
function getHash() { |
... | ... | @@ -193,6 +194,7 @@ |
193 | 194 |
*/ |
194 | 195 |
|
195 | 196 |
$(".branch-item").click(function(ev) { |
197 |
+ _updateDynaTree(); |
|
196 | 198 |
$("#selected-branch").text($(this).text()); |
197 | 199 |
$(window).trigger('hashchange'); |
198 | 200 |
}); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?