3 var sessionStarted
= false;
5 var currentfileContent
= '';
8 var shaLastCommit
= "";
16 * JQuery Case Insensitive :icontains selector
18 $
.expr
[':'].icontains
= function(obj
, index
, meta
, stack
){
19 return (obj
.textContent
.replace(/\
[[0-9]+\
]/g
, "") || obj
.innerText
.replace(/\
[[0-9]+\
]/g
, "") ||
jQuery(obj
).text().replace(/\
[[0-9]+\
]/g
, "") ||
'').toLowerCase().indexOf(meta
[3].toLowerCase()) >= 0;
23 * Quick Search global vars
26 // Current search results preview table
27 var currentTable
= null;
29 //Hightlighted index in search result preview table
30 var currentIndex
= -1;
34 * Add folding and filtering facilities to class description page.
36 $
(document
).ready(function() {
40 $
('a[id=commitBtn]').hide();
41 $
('a[id=cancelBtn]').hide();
42 // Hide Authenfication form
48 * Highlight the spoted element
50 highlightBlock(currentAnchor());
59 $
(document
.createElement("a"))
63 .css("cursor", "pointer")
65 if($
(this).find("a.fold").html() == "+") {
66 $
(this).find("a.fold").html("-");
68 $
(this).find("a.fold").html("+");
70 $
(this).nextAll().toggle();
73 // Insert search field
76 $
(document
.createElement("li"))
78 $
(document
.createElement("form"))
80 $
(document
.createElement("input"))
85 value
: "quick search..."
93 // Select previous result on "Up"
95 // If already on first result, focus search input
96 if(currentIndex
== 0) {
97 $
("#search").val($
(currentTable
.find("tr")[currentIndex]).data("searchDetails").name
);
99 // Else select previous result
100 } else if(currentIndex
> 0) {
101 $
(currentTable
.find("tr")[currentIndex]).removeClass("activeSearchResult");
103 $
(currentTable
.find("tr")[currentIndex]).addClass("activeSearchResult");
104 $
("#search").val($
(currentTable
.find("tr")[currentIndex]).data("searchDetails").name
);
105 $
("#search").focus();
109 // Select next result on "Down"
111 if(currentIndex
< currentTable
.find("tr").length
- 1) {
112 $
(currentTable
.find("tr")[currentIndex]).removeClass("activeSearchResult");
114 $
(currentTable
.find("tr")[currentIndex]).addClass("activeSearchResult");
115 $
("#search").val($
(currentTable
.find("tr")[currentIndex]).data("searchDetails").name
);
116 $
("#search").focus();
119 // Go to url on "Enter"
121 if(currentIndex
> -1) {
122 window
.location
= $
(currentTable
.find("tr")[currentIndex]).data("searchDetails").url
;
125 if($
("#search").val().length
== 0)
128 window
.location
= "full-index.html#q=" + $
("#search").val();
129 if(window
.location
.href
.indexOf("full-index.html") > -1) {
135 // Hide results preview on "Escape"
138 if(currentTable
!= null) {
139 currentTable
.remove();
145 if($
("#search").val().length
== 0) {
149 // Remove previous table
150 if(currentTable
!= null) {
151 currentTable
.remove();
154 // Build results table
156 currentTable
= $
(document
.createElement("table"));
158 // Escape regexp related characters in query
159 var query
= $
("#search").val();
160 query
= query
.replace(/\
[/gi
, "\\[");
161 query
= query
.replace(/\|
/gi
, "\\|");
162 query
= query
.replace(/\*/gi
, "\\*");
163 query
= query
.replace(/\
+/gi
, "\\+");
164 query
= query
.replace(/\\/gi
, "\\\\");
165 query
= query
.replace(/\?/gi
, "\\?");
166 query
= query
.replace(/\
(/gi
, "\\(");
167 query
= query
.replace(/\
)/gi
, "\\)");
170 var regexp
= new RegExp("^" + query
, "i");
171 for(var entry
in entries
) {
175 var result
= entry
.match(regexp
);
176 if(result
!= null && result
.toString().toUpperCase() == $
("#search").val().toUpperCase()) {
177 for(var i
= 0; i
< entries
[entry].length
; i
++) {
182 $
(document
.createElement("tr"))
183 .data("searchDetails", {name
: entry
, url
: entries
[entry][i]["url"]})
184 .data("index", index
)
185 .append($
(document
.createElement("td")).html(entry
))
187 $
(document
.createElement("td"))
188 .addClass("entryInfo")
189 .html(entries
[entry][i]["txt"] + " »"))
190 .mouseover( function() {
191 $
(currentTable
.find("tr")[currentIndex]).removeClass("activeSearchResult");
192 $
(this).addClass("activeSearchResult");
193 currentIndex
= $
(this).data("index");
195 .mouseout( function() {
196 $
(this).removeClass("activeSearchResult");
199 window
.location
= $
(this).data("searchDetails")["url"];
207 // Initialize table properties
208 currentTable
.attr("id", "searchTable");
209 currentTable
.css("position", "absolute");
210 currentTable
.width($
("#search").outerWidth());
211 $
("header").append(currentTable
);
212 currentTable
.offset({left
: $
("#search").offset().left
+ ($
("#search").outerWidth() - currentTable
.outerWidth()), top
: $
("#search").offset().top
+ $
("#search").outerHeight()});
214 // Preselect first entry
215 if(currentTable
.find("tr").length
> 0) {
217 $
(currentTable
.find("tr")[currentIndex]).addClass("activeSearchResult");
218 $
("#search").focus();
223 .focusout(function() {
224 if($
(this).val() == "") {
225 $
(this).addClass("notUsed");
226 $
(this).val("quick search...");
229 .focusin(function() {
230 if($
(this).val() == "quick search...") {
231 $
(this).removeClass("notUsed");
236 .submit( function() {
242 // Close quicksearch list on click
243 $
(document
).click(function(e
) {
244 if(e
.target
!= $
("#search")[0] && e
.target
!= $
("#searchTable")[0]) {
245 if(currentTable
!= null) {
246 currentTable
.remove();
252 // Insert filter field
253 $
("article.filterable h2, nav.filterable h3")
255 $
(document
.createElement("div"))
258 $
(document
.createElement("input"))
265 $
(this).parent().parent().find("ul li:not(:icontains('" + $
(this).val() + "'))").addClass("hide");
266 $
(this).parent().parent().find("ul li:icontains('" + $
(this).val() + "')").removeClass("hide");
268 .focusout(function() {
269 if($
(this).val() == "") {
270 $
(this).addClass("notUsed");
271 $
(this).val("filter...");
274 .focusin(function() {
275 if($
(this).val() == "filter...") {
276 $
(this).removeClass("notUsed");
283 // Filter toggle between H I R in nav porperties list
284 $
("nav.properties.filterable .filter")
286 $
(document
.createElement("a"))
289 title
: "hide inherited properties"
292 if($
(this).hasClass("hidden")) {
293 $
(this).parent().parent().find("li.inherit").show();
295 $
(this).parent().parent().find("li.inherit").hide();
298 $
(this).toggleClass("hidden");
302 $
(document
.createElement("a"))
305 title
: "hide redefined properties"
308 if($
(this).hasClass("hidden")) {
309 $
(this).parent().parent().find("li.redef").show();
311 $
(this).parent().parent().find("li.redef").hide();
314 $
(this).toggleClass("hidden");
318 $
(document
.createElement("a"))
321 title
: "hide introduced properties"
324 if($
(this).hasClass("hidden")) {
325 $
(this).parent().parent().find("li.intro").show();
327 $
(this).parent().parent().find("li.intro").hide();
330 $
(this).toggleClass("hidden");
334 // Filter toggle between I R in
335 $
("article.properties.filterable .filter, article.classes.filterable .filter")
337 $
(document
.createElement("a"))
340 title
: "hide introduced properties"
343 if($
(this).hasClass("hidden")) {
344 $
(this).parent().parent().find("li.intro").show();
346 $
(this).parent().parent().find("li.intro").hide();
349 $
(this).toggleClass("hidden");
353 $
(document
.createElement("a"))
356 title
: "hide redefined properties"
359 if($
(this).hasClass("hidden")) {
360 $
(this).parent().parent().find("li.redef").show();
362 $
(this).parent().parent().find("li.redef").hide();
365 $
(this).toggleClass("hidden");
372 $
("a[href*='#']").click( function() {
373 highlightBlock($
(this).attr("href").split(/#
/)[1]);
376 //Preload filter fields with query string
378 // Hide Authenfication form
379 $
(".popover").hide();
380 // Display Login modal
381 $
("#logGitHub").click(function(){ displayLogginModal(); });
384 // If cookie existing the session is opened
385 if(sessionStarted
){ userB64
= "Basic " + getUserPass("logginNitdoc"); }
387 // Sign In an github user or Log out him
388 $
("#signIn").click(function(){
390 if($
('#loginGit').val() == "" || $
('#passwordGit').val() == ""){ displayMessage('The comment field is empty!', 40, 45); }
393 userName
= $
('#loginGit').val();
394 password
= $
('#passwordGit').val();
395 repoName
= $
('#repositoryGit').val();
396 branchName
= $
('#branchGit').val();
397 userB64
= "Basic " + base64
.encode(userName
+':'+password
);
398 setCookie("logginNitdoc", base64
.encode(userName
+':'+password
+':'+repoName
+':'+branchName
), 1);
399 $
('#loginGit').val("");
400 $
('#passwordGit').val("");
405 // Delete cookie and reset settings
406 del_cookie("logginNitdoc");
408 displayLogginModal();
411 // Activate edit mode
412 $
('pre[class=text_label]').click(function(){
413 // the customer is loggued ?
414 if(!sessionStarted || userName
== ""){
415 // No => nothing happen
419 var arrayNew
= $
(this).text().split('\n');
420 var lNew
= arrayNew
.length
- 1;
423 for (var i
= 0; i
< lNew
; i
++) {
424 adapt
+= arrayNew
[i];
425 if(i
< lNew
-1){ adapt
+= "\n"; }
431 $
(this).next().show();
432 // Show cancel button
433 $
(this).next().next().show();
434 // Show commit button
435 $
(this).next().next().next().show();
436 // Add text in edit box
437 if($
(this).next().val() == ""){ $
(this).next().val(adapt
); }
439 $
(this).next().height($
(this).next().prop("scrollHeight"));
441 $
(this).next().select();
442 preElement
= $
(this);
446 // Disable the edit mode
447 $
('a[id=cancelBtn]').click(function(){
448 if(editComment
> 0){ editComment
-= 1; }
452 $
(this).next().hide();
454 $
(this).prev().hide();
456 $
(this).prev().prev().show();
459 // Display commit form
460 $
('a[id=commitBtn]').click(function(){
461 updateComment
= $
(this).prev().prev().val();
462 commentType
= $
(this).prev().prev().prev().attr('type');
464 if(updateComment
== ""){ displayMessage('The comment field is empty!', 40, 45); }
467 displayMessage("You need to be loggued before commit something", 45, 40);
468 displayLogginModal();
471 $
('#commitMessage').val('New commit');
472 pathFile
= $
(this).prev().prev().prev().attr('tag');
473 $
('#modal').show().prepend('<a class="close"><img src="resources/icons/close.png" class="btn_close" title="Close" alt="Close" /></a>');
474 $
('body').append('<div id="fade"></div>');
475 $
('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn();
480 $
('.btn_close').click(function(){
482 $
(this).next().hide();
483 if(editComment
> 0){ editComment
-= 1; }
486 //Close Popups and Fade Layer
487 $
('body').on('click', 'a.close, #fade', function() {
488 if(editComment
> 0){ editComment
-= 1; }
489 $
('#fade , #modal').fadeOut(function() {
490 $
('#fade, a.close').remove();
492 $
('#modalQuestion').hide();
495 $
('#loginAction').click(function(){
499 // Look if the customer is logged
501 displayMessage("You need to be loggued before commit something", 100, 40);
502 $
('.popover').show();
505 else{ userB64
= "Basic " + getUserPass("logginNitdoc"); }
506 githubRepo
= repoName
;
508 commitMessage
= $
('#commitMessage').val();
509 if(commitMessage
== ""){ commitMessage
= "New commit";}
511 if ($
.trim(updateComment
) == ''){ this.value
= (this.defaultValue ?
this.defaultValue
: ''); }
512 else{ startCommitProcess(); }
514 $
('#modal, #modalQuestion').fadeOut(function() {
516 $
('#password').val("");
517 $
('textarea').hide();
518 $
('textarea').prev().show();
520 $
('a[id=cancelBtn]').hide();
521 $
('a[id=commitBtn]').hide();
525 /* Parse current URL and return anchor name */
526 function currentAnchor() {
527 var index
= document
.location
.hash
.indexOf("#");
529 return document
.location
.hash
.substring(index
+ 1);
534 /* Prealod filters field using search query */
535 function preloadFilters() {
536 // Parse URL and get query string
537 var search
= currentAnchor();
539 if(search
== null || search
.indexOf("q=") == -1)
542 search
= search
.substring(2, search
.length
);
544 if(search
== "" || search
== "undefined")
547 $
(":text").val(search
);
549 .removeClass("notUsed")
554 /* Hightlight the spoted block */
555 function highlightBlock(a
) {
560 $
(".highlighted").removeClass("highlighted");
562 var target
= $
("#" + a
);
564 if(target
.is("article")) {
565 target
.parent().addClass("highlighted");
568 target
.addClass("highlighted");
572 // Init process to commit the new comment
573 function startCommitProcess()
575 var numL
= preElement
.attr("title");
576 commentLineStart
= numL
.split('-')[0] - 1;
577 commentLineEnd
= (commentLineStart
+ preElement
.text().split('\n').length
) - 1;
579 replaceComment(updateComment
, currentfileContent
);
585 function displayLogginModal(){
586 if ($
('.popover').is(':hidden')) { $
('.popover').show(); }
587 else { $
('.popover').hide(); }
591 function updateDisplaying(){
594 $
('#loginGit').hide();
595 $
('#passwordGit').hide();
596 $
('#lbpasswordGit').hide();
597 $
('#lbloginGit').hide();
598 $
('#repositoryGit').hide();
599 $
('#lbrepositoryGit').hide();
600 $
('#lbbranchGit').hide();
601 $
('#branchGit').hide();
602 $
("#liGitHub").attr("class", "current");
603 $
("#imgGitHub").attr("src", "resources/icons/github-icon-w.png");
604 $
('#nickName').text(userName
);
605 $
('#githubAccount').attr("href", "https://github.com/"+userName
);
606 $
('#logginMessage').css({'display' : 'block'});
607 $
('#logginMessage').css({'text-align' : 'center'});
608 $
('.popover').css({'height' : '80px'});
609 $
('#signIn').text("Sign out");
610 sessionStarted
= true;
614 sessionStarted
= false;
615 $
('#logginMessage').css({'display' : 'none'});
616 $
("#liGitHub").attr("class", "");
617 $
("#imgGitHub").attr("src", "resources/icons/github-icon.png");
618 $
('#loginGit').val("");
619 $
('#passwordGit').val("");
620 $
('#nickName').text("");
621 $
('.popover').css({'height' : '280px'});
622 $
('#logginMessage').css({'display' : 'none'});
623 $
('#repositoryGit').val($
('#repoName').attr('name'));
624 $
('#branchGit').val('wikidoc');
625 $
('#signIn').text("Sign In");
626 $
('#loginGit').show();
627 $
('#passwordGit').show();
628 $
('#lbpasswordGit').show();
629 $
('#lbloginGit').show();
630 $
('#repositoryGit').show();
631 $
('#lbrepositoryGit').show();
632 $
('#lbbranchGit').show();
633 $
('#branchGit').show();
637 function setCookie(c_name
, value
, exdays
)
639 var exdate
=new Date();
640 exdate
.setDate(exdate
.getDate() + exdays
);
641 var c_value
=escape(value
) + ((exdays
==null) ?
"" : "; expires="+exdate
.toUTCString());
642 document
.cookie
=c_name
+ "=" + c_value
;
645 function del_cookie(c_name
)
647 document
.cookie
= c_name
+ '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
650 function getCookie(c_name
)
652 var c_value
= document
.cookie
;
653 var c_start
= c_value
.indexOf(" " + c_name
+ "=");
654 if (c_start
== -1) { c_start
= c_value
.indexOf(c_name
+ "="); }
655 if (c_start
== -1) { c_value
= null; }
658 c_start
= c_value
.indexOf("=", c_start
) + 1;
659 var c_end
= c_value
.indexOf(";", c_start
);
660 if (c_end
== -1) { c_end
= c_value
.length
; }
661 c_value
= unescape(c_value
.substring(c_start
,c_end
));
666 function getUserPass(c_name
){
667 var cookie
= base64
.decode(getCookie(c_name
));
668 return base64
.encode(cookie
.split(':')[0] + ':' + cookie
.split(':')[1]);
671 function checkCookie()
673 var cookie
=getCookie("logginNitdoc");
674 if (cookie
!=null && cookie
!="")
676 cookie
= base64
.decode(cookie
);
677 userName
= cookie
.split(':')[0];
678 repoName
= cookie
.split(':')[2];
679 branchName
= cookie
.split(':')[3];
682 else { return false; }
690 base64
.PADCHAR
= '=';
691 base64
.ALPHA
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
692 base64
.getbyte64
= function(s
,i
) {
693 // This is oddly fast, except on Chrome/V8.
694 // Minimal or no improvement in performance by using a
695 // object with properties mapping chars to value (eg. 'A': 0)
696 var idx
= base64
.ALPHA
.indexOf(s
.charAt(i
));
698 throw "Cannot decode base64";
703 base64
.decode
= function(s
) {
706 var getbyte64
= base64
.getbyte64
;
714 throw "Cannot decode base64";
718 if (s
.charAt(imax
-1) == base64
.PADCHAR
) {
720 if (s
.charAt(imax
-2) == base64
.PADCHAR
) {
723 // either way, we want to ignore this last block
728 for (i
= 0; i
< imax
; i
+= 4) {
729 b10
= (getbyte64(s
,i
) << 18) |
(getbyte64(s
,i
+1) << 12) |
730 (getbyte64(s
,i
+2) << 6) |
getbyte64(s
,i
+3);
731 x
.push(String
.fromCharCode(b10
>> 16, (b10
>> 8) & 0xff, b10
& 0xff));
736 b10
= (getbyte64(s
,i
) << 18) |
(getbyte64(s
,i
+1) << 12) |
(getbyte64(s
,i
+2) << 6)
737 x
.push(String
.fromCharCode(b10
>> 16, (b10
>> 8) & 0xff));
740 b10
= (getbyte64(s
,i
) << 18) |
(getbyte64(s
,i
+1) << 12);
741 x
.push(String
.fromCharCode(b10
>> 16));
747 base64
.getbyte
= function(s
,i
) {
748 var x
= s
.charCodeAt(i
);
750 throw "INVALID_CHARACTER_ERR: DOM Exception 5";
756 base64
.encode
= function(s
) {
757 if (arguments
.length
!= 1) {
758 throw "SyntaxError: Not enough arguments";
760 var padchar
= base64
.PADCHAR
;
761 var alpha
= base64
.ALPHA
;
762 var getbyte
= base64
.getbyte
;
770 var imax
= s
.length
- s
.length
% 3;
775 for (i
= 0; i
< imax
; i
+= 3) {
776 b10
= (getbyte(s
,i
) << 16) |
(getbyte(s
,i
+1) << 8) |
getbyte(s
,i
+2);
777 x
.push(alpha
.charAt(b10
>> 18));
778 x
.push(alpha
.charAt((b10
>> 12) & 0x3F));
779 x
.push(alpha
.charAt((b10
>> 6) & 0x3f));
780 x
.push(alpha
.charAt(b10
& 0x3f));
782 switch (s
.length
- imax
) {
784 b10
= getbyte(s
,i
) << 16;
785 x
.push(alpha
.charAt(b10
>> 18) + alpha
.charAt((b10
>> 12) & 0x3F) +
789 b10
= (getbyte(s
,i
) << 16) |
(getbyte(s
,i
+1) << 8);
790 x
.push(alpha
.charAt(b10
>> 18) + alpha
.charAt((b10
>> 12) & 0x3F) +
791 alpha
.charAt((b10
>> 6) & 0x3f) + padchar
);
797 $
.fn
.spin
= function(opts
) {
798 this.each(function() {
806 if (opts
!== false) {
807 data
.spinner
= new Spinner($
.extend({color
: $
this.css('color')}, opts
)).spin(this);
813 function getLastCommit()
816 if(sessionStarted
){ urlHead
= "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/refs/heads/"+branchName
;}
818 // TODO: get url of the original repo.
823 beforeSend
: function (xhr
) {
824 if (userB64
!= ""){ xhr
.setRequestHeader ("Authorization", userB64
); }
830 success
: function(success
)
832 shaLastCommit
= success
.object
.sha
;
837 function getBaseTree()
840 beforeSend
: function (xhr
) {
841 if (userB64
!= ""){ xhr
.setRequestHeader ("Authorization", userB64
); }
844 url
: "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/commits/" + shaLastCommit
,
847 success
: function(success
)
849 shaBaseTree
= success
.tree
.sha
;
850 if (state
){ setBlob(); }
859 function setNewTree()
862 beforeSend
: function (xhr
) { xhr
.setRequestHeader ("Authorization", userB64
); },
864 url
: "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/trees",
866 data
:'{ "base_tree" : "'+shaBaseTree
+'", '+
868 '"path":"'+ pathFile
+'",'+
871 '"sha": "'+ shaBlob
+'"'+
874 success
: function(success
)
875 { // si l'appel a bien fonctionné
876 shaNewTree
= JSON
.parse(success
).sha
;
885 function setNewCommit()
888 beforeSend
: function (xhr
) { xhr
.setRequestHeader ("Authorization", userB64
); },
890 url
: "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/commits",
892 data
:'{ "message" : "'+ commitMessage
+'", '+
893 '"parents" :"'+shaLastCommit
+'",'+
894 '"tree": "'+shaNewTree
+'"'+
896 success
: function(success
)
898 shaNewCommit
= JSON
.parse(success
).sha
;
911 beforeSend
: function (xhr
) { xhr
.setRequestHeader ("Authorization", userB64
); },
913 url
: "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/refs/heads/"+branchName
,
914 data
:'{ "sha" : "'+shaNewCommit
+'", '+
917 success
: function(success
) { displayMessage('Commit created successfully', 40, 40); },
918 error
:function(error
){ displayMessage('Error ' + JSON
.parse(error
).object
.message
, 40, 40); }
926 beforeSend
: function (xhr
) { xhr
.setRequestHeader ("Authorization", userB64
); },
928 url
: "https://api.github.com/repos/"+userName
+"/"+githubRepo
+"/git/blobs",
930 data
:'{ "content" : "'+text
.replace(/\r?
\n/g
, '\\n').replace(/\t/g
, '\\t').replace(/\"/g
,'\\"')+'", '+
931 '"encoding" :"utf-8"'+
933 success
: function(success
)
935 shaBlob
= JSON
.parse(success
).sha
;
938 error
:function(error
){
939 displayMessage('Error : Problem parsing JSON', 40, 40);
945 // Display file content
946 function getFileContent(urlFile
, newComment
)
949 beforeSend
: function (xhr
) {
950 xhr
.setRequestHeader ("Accept", "application/vnd.github-blob.raw");
951 if (userB64
!= ""){ xhr
.setRequestHeader ("Authorization", userB64
); }
956 success
: function(success
)
959 replaceComment(newComment
, success
);
964 function replaceComment(newComment
, fileContent
){
965 var arrayNew
= newComment
.split('\n');
966 var lNew
= arrayNew
.length
;
968 var lines
= fileContent
.split("\n");
969 for (var i
= 0; i
< lines
.length
; i
++) {
970 if(i
== commentLineStart
){
971 // We change the comment
972 for(var j
= 0; j
< lNew
; j
++){
973 if(commentType
== 1){ text
+= "\t# " + arrayNew
[j] + "\n"; }
975 if(arrayNew
[j] == ""){ text
+= "#"+"\n"; }
976 else{ text
+= "# " + arrayNew
[j] + "\n"; }
980 else if(i
< commentLineStart || i
>= commentLineEnd
){
981 if(i
== lines
.length
-1){ text
+= lines
[i]; }
982 else{ text
+= lines
[i] + "\n"; }
987 function getCommentLastCommit(path
){
990 if(shaLastCommit
!= ""){
991 if (checkCookie()) { urlRaw
="https://rawgithub.com/"+ userName
+"/"+ repoName
+"/" + shaLastCommit
+ "/" + path
; }
992 else{ urlRaw
="https://rawgithub.com/StefanLage/"+ $
('#repoName').attr('name') +"/" + shaLastCommit
+ "/" + path
; }
998 success
: function(success
)
1000 currentfileContent
= success
;
1006 function displayMessage(msg
, widthDiv
, margModal
){
1008 $
('#btnCreateBranch').css('margin-left',widthDiv
+ '%');
1009 $
('#txtQuestion').text(msg
);
1010 $
('#btnCreateBranch').text("Ok");
1011 $
('#btnCancelBranch').hide();
1012 $
('#modalQuestion').css({'left' : margModal
+ '%'})
1013 $
('#modalQuestion').show();
1014 $
('#modalQuestion').show().prepend('<a class="close"><img src="resources/icons/close.png" class="btnCloseQuestion" title="Close" alt="Close" /></a>');
1015 $
('body').append('<div id="fade"></div>');
1016 $
('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn();