Show More
@@ -13,7 +13,7 b' if (typeof console == "undefined" || typ' | |||
|
13 | 13 | * Inspired by https://gist.github.com/1049426 |
|
14 | 14 | */ |
|
15 | 15 | String.prototype.format = function() { |
|
16 |
|
|
|
16 | function format() { | |
|
17 | 17 | var str = this; |
|
18 | 18 | var len = arguments.length+1; |
|
19 | 19 | var safe = undefined; |
@@ -22,18 +22,18 b' String.prototype.format = function() {' | |||
|
22 | 22 | // For each {0} {1} {n...} replace with the argument in that position. If |
|
23 | 23 | // the argument is an object or an array it will be stringified to JSON. |
|
24 | 24 | for (var i=0; i < len; arg = arguments[i++]) { |
|
25 | safe = typeof arg === 'object' ? JSON.stringify(arg) : arg; | |
|
26 | str = str.replace(RegExp('\\{'+(i-1)+'\\}', 'g'), safe); | |
|
25 | safe = typeof arg === 'object' ? JSON.stringify(arg) : arg; | |
|
26 | str = str.replace(RegExp('\\{'+(i-1)+'\\}', 'g'), safe); | |
|
27 | 27 | } |
|
28 | 28 | return str; |
|
29 |
|
|
|
29 | } | |
|
30 | 30 | |
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
31 | // Save a reference of what may already exist under the property native. | |
|
32 | // Allows for doing something like: if("".format.native) { /* use native */ } | |
|
33 | format.native = String.prototype.format; | |
|
34 | 34 | |
|
35 |
|
|
|
36 |
|
|
|
35 | // Replace the prototype property | |
|
36 | return format; | |
|
37 | 37 | |
|
38 | 38 | }(); |
|
39 | 39 | |
@@ -620,34 +620,34 b' var q_filter = function(target,nodes,dis' | |||
|
620 | 620 | } |
|
621 | 621 | |
|
622 | 622 | F.updateFilter = function() { |
|
623 | // Reset timeout | |
|
624 | F.filterTimeout = null; | |
|
623 | // Reset timeout | |
|
624 | F.filterTimeout = null; | |
|
625 | 625 | |
|
626 | var obsolete = []; | |
|
626 | var obsolete = []; | |
|
627 | 627 | |
|
628 | var req = q_filter_field.value.toLowerCase(); | |
|
628 | var req = q_filter_field.value.toLowerCase(); | |
|
629 | 629 | |
|
630 | var l = nodes.length; | |
|
631 | var i; | |
|
632 | var showing = 0; | |
|
630 | var l = nodes.length; | |
|
631 | var i; | |
|
632 | var showing = 0; | |
|
633 | 633 | |
|
634 | for (i=0;i<l;i++ ){ | |
|
635 | var n = nodes[i]; | |
|
636 | var target_element = display_element(n) | |
|
637 | if(req && n.innerHTML.toLowerCase().indexOf(req) == -1){ | |
|
638 | hide_node(target_element); | |
|
639 | } | |
|
640 | else{ | |
|
641 | show_node(target_element); | |
|
642 | showing+=1; | |
|
643 | } | |
|
644 | } | |
|
634 | for (i=0;i<l;i++ ){ | |
|
635 | var n = nodes[i]; | |
|
636 | var target_element = display_element(n) | |
|
637 | if(req && n.innerHTML.toLowerCase().indexOf(req) == -1){ | |
|
638 | hide_node(target_element); | |
|
639 | } | |
|
640 | else{ | |
|
641 | show_node(target_element); | |
|
642 | showing+=1; | |
|
643 | } | |
|
644 | } | |
|
645 | 645 | |
|
646 | // if repo_count is set update the number | |
|
647 | var cnt = YUD.get('repo_count'); | |
|
648 | if(cnt){ | |
|
649 | YUD.get('repo_count').innerHTML = showing; | |
|
650 | } | |
|
646 | // if repo_count is set update the number | |
|
647 | var cnt = YUD.get('repo_count'); | |
|
648 | if(cnt){ | |
|
649 | YUD.get('repo_count').innerHTML = showing; | |
|
650 | } | |
|
651 | 651 | } |
|
652 | 652 | }; |
|
653 | 653 | |
@@ -693,111 +693,111 b' var createInlineForm = function(parent_t' | |||
|
693 | 693 | * block at the very bottom |
|
694 | 694 | */ |
|
695 | 695 | var injectInlineForm = function(tr){ |
|
696 |
|
|
|
697 |
|
|
|
698 |
|
|
|
699 |
|
|
|
700 |
|
|
|
701 |
|
|
|
702 |
|
|
|
703 |
|
|
|
704 |
|
|
|
705 |
|
|
|
706 |
|
|
|
707 |
|
|
|
708 |
|
|
|
709 |
|
|
|
696 | if(!YUD.hasClass(tr, 'line')){ | |
|
697 | return | |
|
698 | } | |
|
699 | var submit_url = AJAX_COMMENT_URL; | |
|
700 | var _td = YUD.getElementsByClassName('code',null,tr)[0]; | |
|
701 | if(YUD.hasClass(tr,'form-open') || YUD.hasClass(tr,'context') || YUD.hasClass(_td,'no-comment')){ | |
|
702 | return | |
|
703 | } | |
|
704 | YUD.addClass(tr,'form-open'); | |
|
705 | YUD.addClass(tr,'hl-comment'); | |
|
706 | var node = YUD.getElementsByClassName('full_f_path',null,tr.parentNode.parentNode.parentNode)[0]; | |
|
707 | var f_path = YUD.getAttribute(node,'path'); | |
|
708 | var lineno = getLineNo(tr); | |
|
709 | var form = createInlineForm(tr, f_path, lineno, submit_url); | |
|
710 | 710 | |
|
711 |
|
|
|
712 |
|
|
|
713 |
|
|
|
714 |
|
|
|
715 |
|
|
|
716 |
|
|
|
717 |
|
|
|
718 |
|
|
|
719 |
|
|
|
720 |
|
|
|
721 |
|
|
|
722 |
|
|
|
723 |
|
|
|
724 |
|
|
|
725 |
|
|
|
711 | var parent = tr; | |
|
712 | while (1){ | |
|
713 | var n = parent.nextElementSibling; | |
|
714 | // next element are comments ! | |
|
715 | if(YUD.hasClass(n,'inline-comments')){ | |
|
716 | parent = n; | |
|
717 | } | |
|
718 | else{ | |
|
719 | break; | |
|
720 | } | |
|
721 | } | |
|
722 | YUD.insertAfter(form,parent); | |
|
723 | var f = YUD.get(form); | |
|
724 | var overlay = YUD.getElementsByClassName('overlay',null,f)[0]; | |
|
725 | var _form = YUD.getElementsByClassName('inline-form',null,f)[0]; | |
|
726 | 726 | |
|
727 |
|
|
|
728 |
|
|
|
727 | YUE.on(YUD.get(_form), 'submit',function(e){ | |
|
728 | YUE.preventDefault(e); | |
|
729 | 729 | |
|
730 |
|
|
|
731 |
|
|
|
732 |
|
|
|
730 | //ajax submit | |
|
731 | var text = YUD.get('text_'+lineno).value; | |
|
732 | var postData = { | |
|
733 | 733 | 'text':text, |
|
734 | 734 | 'f_path':f_path, |
|
735 | 735 | 'line':lineno |
|
736 |
|
|
|
736 | }; | |
|
737 | 737 | |
|
738 |
|
|
|
739 |
|
|
|
740 |
|
|
|
741 |
|
|
|
742 |
|
|
|
743 |
|
|
|
744 |
|
|
|
745 |
|
|
|
738 | if(lineno === undefined){ | |
|
739 | alert('missing line !'); | |
|
740 | return | |
|
741 | } | |
|
742 | if(f_path === undefined){ | |
|
743 | alert('missing file path !'); | |
|
744 | return | |
|
745 | } | |
|
746 | 746 | |
|
747 |
|
|
|
748 |
|
|
|
749 |
|
|
|
747 | if(text == ""){ | |
|
748 | return | |
|
749 | } | |
|
750 | 750 | |
|
751 |
|
|
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
|
755 |
|
|
|
756 |
|
|
|
751 | var success = function(o){ | |
|
752 | YUD.removeClass(tr, 'form-open'); | |
|
753 | removeInlineForm(f); | |
|
754 | var json_data = JSON.parse(o.responseText); | |
|
755 | renderInlineComment(json_data); | |
|
756 | }; | |
|
757 | 757 | |
|
758 |
|
|
|
759 |
|
|
|
760 |
|
|
|
761 |
|
|
|
762 |
|
|
|
763 |
|
|
|
764 |
|
|
|
758 | if (YUD.hasClass(overlay,'overlay')){ | |
|
759 | var w = _form.offsetWidth; | |
|
760 | var h = _form.offsetHeight; | |
|
761 | YUD.setStyle(overlay,'width',w+'px'); | |
|
762 | YUD.setStyle(overlay,'height',h+'px'); | |
|
763 | } | |
|
764 | YUD.addClass(overlay, 'submitting'); | |
|
765 | 765 | |
|
766 |
|
|
|
767 |
|
|
|
766 | ajaxPOST(submit_url, postData, success); | |
|
767 | }); | |
|
768 | 768 | |
|
769 |
|
|
|
770 |
|
|
|
771 |
|
|
|
772 |
|
|
|
773 |
|
|
|
774 |
|
|
|
775 |
|
|
|
776 |
|
|
|
777 |
|
|
|
778 |
|
|
|
769 | YUE.on('preview-btn_'+lineno, 'click', function(e){ | |
|
770 | var _text = YUD.get('text_'+lineno).value; | |
|
771 | if(!_text){ | |
|
772 | return | |
|
773 | } | |
|
774 | var post_data = {'text': _text}; | |
|
775 | YUD.addClass('preview-box_'+lineno, 'unloaded'); | |
|
776 | YUD.get('preview-box_'+lineno).innerHTML = _TM['Loading ...']; | |
|
777 | YUD.setStyle('edit-container_'+lineno, 'display', 'none'); | |
|
778 | YUD.setStyle('preview-container_'+lineno, 'display', ''); | |
|
779 | 779 | |
|
780 |
|
|
|
781 |
|
|
|
782 |
|
|
|
783 |
|
|
|
784 |
|
|
|
785 |
|
|
|
786 |
|
|
|
787 |
|
|
|
788 |
|
|
|
789 |
|
|
|
780 | var url = pyroutes.url('changeset_comment_preview', {'repo_name': REPO_NAME}); | |
|
781 | ajaxPOST(url,post_data,function(o){ | |
|
782 | YUD.get('preview-box_'+lineno).innerHTML = o.responseText; | |
|
783 | YUD.removeClass('preview-box_'+lineno, 'unloaded'); | |
|
784 | }) | |
|
785 | }) | |
|
786 | YUE.on('edit-btn_'+lineno, 'click', function(e){ | |
|
787 | YUD.setStyle('edit-container_'+lineno, 'display', ''); | |
|
788 | YUD.setStyle('preview-container_'+lineno, 'display', 'none'); | |
|
789 | }) | |
|
790 | 790 | |
|
791 |
|
|
|
792 |
|
|
|
793 |
|
|
|
794 |
|
|
|
791 | setTimeout(function(){ | |
|
792 | // callbacks | |
|
793 | tooltip_activate(); | |
|
794 | MentionsAutoComplete('text_'+lineno, 'mentions_container_'+lineno, | |
|
795 | 795 | _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
796 |
|
|
|
797 |
|
|
|
798 |
|
|
|
799 |
|
|
|
800 |
|
|
|
796 | var _e = YUD.get('text_'+lineno); | |
|
797 | if(_e){ | |
|
798 | _e.focus(); | |
|
799 | } | |
|
800 | },10) | |
|
801 | 801 | }; |
|
802 | 802 | |
|
803 | 803 | var deleteComment = function(comment_id){ |
@@ -852,22 +852,22 b' var placeAddButton = function(target_tr)' | |||
|
852 | 852 | } |
|
853 | 853 | var last_node = target_tr; |
|
854 | 854 | //scann |
|
855 |
|
|
|
856 |
|
|
|
857 |
|
|
|
858 |
|
|
|
859 |
|
|
|
860 |
|
|
|
861 |
|
|
|
862 |
|
|
|
863 |
|
|
|
864 |
|
|
|
865 |
|
|
|
866 |
|
|
|
867 |
|
|
|
868 |
|
|
|
869 |
|
|
|
870 |
|
|
|
855 | while (1){ | |
|
856 | var n = last_node.nextElementSibling; | |
|
857 | // next element are comments ! | |
|
858 | if(YUD.hasClass(n,'inline-comments')){ | |
|
859 | last_node = n; | |
|
860 | //also remove the comment button from previous | |
|
861 | var comment_add_buttons = YUD.getElementsByClassName('add-comment',null,last_node); | |
|
862 | for(var i=0;i<comment_add_buttons.length;i++){ | |
|
863 | var b = comment_add_buttons[i]; | |
|
864 | b.parentNode.removeChild(b); | |
|
865 | } | |
|
866 | } | |
|
867 | else{ | |
|
868 | break; | |
|
869 | } | |
|
870 | } | |
|
871 | 871 | |
|
872 | 872 | var add = createInlineAddButton(target_tr); |
|
873 | 873 | // get the comment div |
@@ -880,30 +880,30 b' var placeAddButton = function(target_tr)' | |||
|
880 | 880 | * Places the inline comment into the changeset block in proper line position |
|
881 | 881 | */ |
|
882 | 882 | var placeInline = function(target_container,lineno,html){ |
|
883 |
|
|
|
884 |
|
|
|
885 |
|
|
|
883 | var lineid = "{0}_{1}".format(target_container,lineno); | |
|
884 | var target_line = YUD.get(lineid); | |
|
885 | var comment = new YAHOO.util.Element(tableTr('inline-comments',html)) | |
|
886 | 886 | |
|
887 |
|
|
|
888 |
|
|
|
889 |
|
|
|
890 |
|
|
|
891 |
|
|
|
892 |
|
|
|
893 |
|
|
|
894 |
|
|
|
895 |
|
|
|
896 |
|
|
|
897 |
|
|
|
898 |
|
|
|
899 |
|
|
|
900 |
|
|
|
901 |
|
|
|
887 | // check if there are comments already ! | |
|
888 | var parent = target_line.parentNode; | |
|
889 | var root_parent = parent; | |
|
890 | while (1){ | |
|
891 | var n = parent.nextElementSibling; | |
|
892 | // next element are comments ! | |
|
893 | if(YUD.hasClass(n,'inline-comments')){ | |
|
894 | parent = n; | |
|
895 | } | |
|
896 | else{ | |
|
897 | break; | |
|
898 | } | |
|
899 | } | |
|
900 | // put in the comment at the bottom | |
|
901 | YUD.insertAfter(comment,parent); | |
|
902 | 902 | |
|
903 |
|
|
|
904 |
|
|
|
903 | // scann nodes, and attach add button to last one | |
|
904 | placeAddButton(root_parent); | |
|
905 | 905 | |
|
906 |
|
|
|
906 | return target_line; | |
|
907 | 907 | } |
|
908 | 908 | |
|
909 | 909 | /** |
@@ -911,12 +911,12 b' var placeInline = function(target_contai' | |||
|
911 | 911 | */ |
|
912 | 912 | var renderInlineComment = function(json_data){ |
|
913 | 913 | try{ |
|
914 | var html = json_data['rendered_text']; | |
|
915 | var lineno = json_data['line_no']; | |
|
916 | var target_id = json_data['target_id']; | |
|
917 | placeInline(target_id, lineno, html); | |
|
914 | var html = json_data['rendered_text']; | |
|
915 | var lineno = json_data['line_no']; | |
|
916 | var target_id = json_data['target_id']; | |
|
917 | placeInline(target_id, lineno, html); | |
|
918 | 918 | }catch(e){ |
|
919 | console.log(e); | |
|
919 | console.log(e); | |
|
920 | 920 | } |
|
921 | 921 | } |
|
922 | 922 | |
@@ -963,28 +963,28 b' var fileBrowserListeners = function(curr' | |||
|
963 | 963 | var nodes = null; |
|
964 | 964 | |
|
965 | 965 | F.initFilter = function(){ |
|
966 | YUD.setStyle('node_filter_box_loading','display',''); | |
|
967 | YUD.setStyle('search_activate_id','display','none'); | |
|
968 | YUD.setStyle('add_node_id','display','none'); | |
|
969 | YUC.initHeader('X-PARTIAL-XHR',true); | |
|
970 | YUC.asyncRequest('GET', node_list_url, { | |
|
971 | success:function(o){ | |
|
972 | nodes = JSON.parse(o.responseText).nodes; | |
|
973 | YUD.setStyle('node_filter_box_loading','display','none'); | |
|
974 | YUD.setStyle('node_filter_box','display',''); | |
|
975 | n_filter.focus(); | |
|
976 | if(YUD.hasClass(n_filter,'init')){ | |
|
977 | n_filter.value = ''; | |
|
978 | YUD.removeClass(n_filter,'init'); | |
|
966 | YUD.setStyle('node_filter_box_loading','display',''); | |
|
967 | YUD.setStyle('search_activate_id','display','none'); | |
|
968 | YUD.setStyle('add_node_id','display','none'); | |
|
969 | YUC.initHeader('X-PARTIAL-XHR',true); | |
|
970 | YUC.asyncRequest('GET', node_list_url, { | |
|
971 | success:function(o){ | |
|
972 | nodes = JSON.parse(o.responseText).nodes; | |
|
973 | YUD.setStyle('node_filter_box_loading','display','none'); | |
|
974 | YUD.setStyle('node_filter_box','display',''); | |
|
975 | n_filter.focus(); | |
|
976 | if(YUD.hasClass(n_filter,'init')){ | |
|
977 | n_filter.value = ''; | |
|
978 | YUD.removeClass(n_filter,'init'); | |
|
979 | } | |
|
980 | }, | |
|
981 | failure:function(o){ | |
|
982 | console.log('failed to load'); | |
|
979 | 983 | } |
|
980 |
|
|
|
981 | failure:function(o){ | |
|
982 | console.log('failed to load'); | |
|
983 | } | |
|
984 | },null); | |
|
984 | },null); | |
|
985 | 985 | } |
|
986 | 986 | |
|
987 |
F.updateFilter |
|
|
987 | F.updateFilter = function(e) { | |
|
988 | 988 | return function(){ |
|
989 | 989 | // Reset timeout |
|
990 | 990 | F.filterTimeout = null; |
@@ -1033,49 +1033,49 b' var fileBrowserListeners = function(curr' | |||
|
1033 | 1033 | }; |
|
1034 | 1034 | |
|
1035 | 1035 | YUE.on(YUD.get('filter_activate'),'click',function(){ |
|
1036 | F.initFilter(); | |
|
1037 | }) | |
|
1036 | F.initFilter(); | |
|
1037 | }) | |
|
1038 | 1038 | YUE.on(n_filter,'click',function(){ |
|
1039 | if(YUD.hasClass(n_filter,'init')){ | |
|
1040 | n_filter.value = ''; | |
|
1041 | YUD.removeClass(n_filter,'init'); | |
|
1042 | } | |
|
1043 | }); | |
|
1039 | if(YUD.hasClass(n_filter,'init')){ | |
|
1040 | n_filter.value = ''; | |
|
1041 | YUD.removeClass(n_filter,'init'); | |
|
1042 | } | |
|
1043 | }); | |
|
1044 | 1044 | YUE.on(n_filter,'keyup',function(e){ |
|
1045 | clearTimeout(F.filterTimeout); | |
|
1046 | F.filterTimeout = setTimeout(F.updateFilter(e),600); | |
|
1047 | }); | |
|
1045 | clearTimeout(F.filterTimeout); | |
|
1046 | F.filterTimeout = setTimeout(F.updateFilter(e),600); | |
|
1047 | }); | |
|
1048 | 1048 | }; |
|
1049 | 1049 | |
|
1050 | 1050 | |
|
1051 | 1051 | var initCodeMirror = function(textAreadId,resetUrl){ |
|
1052 | 1052 | var myCodeMirror = CodeMirror.fromTextArea(YUD.get(textAreadId),{ |
|
1053 | mode: "null", | |
|
1054 | lineNumbers:true, | |
|
1055 | indentUnit: 4 | |
|
1056 |
|
|
|
1053 | mode: "null", | |
|
1054 | lineNumbers:true, | |
|
1055 | indentUnit: 4 | |
|
1056 | }); | |
|
1057 | 1057 | YUE.on('reset','click',function(e){ |
|
1058 | window.location=resetUrl | |
|
1059 | }); | |
|
1058 | window.location=resetUrl | |
|
1059 | }); | |
|
1060 | 1060 | |
|
1061 | 1061 | YUE.on('file_enable','click',function(){ |
|
1062 | YUD.setStyle('editor_container','display',''); | |
|
1063 | YUD.setStyle('upload_file_container','display','none'); | |
|
1064 | YUD.setStyle('filename_container','display',''); | |
|
1065 | }); | |
|
1062 | YUD.setStyle('editor_container','display',''); | |
|
1063 | YUD.setStyle('upload_file_container','display','none'); | |
|
1064 | YUD.setStyle('filename_container','display',''); | |
|
1065 | }); | |
|
1066 | 1066 | |
|
1067 | 1067 | YUE.on('upload_file_enable','click',function(){ |
|
1068 | YUD.setStyle('editor_container','display','none'); | |
|
1069 | YUD.setStyle('upload_file_container','display',''); | |
|
1070 | YUD.setStyle('filename_container','display','none'); | |
|
1071 | }); | |
|
1068 | YUD.setStyle('editor_container','display','none'); | |
|
1069 | YUD.setStyle('upload_file_container','display',''); | |
|
1070 | YUD.setStyle('filename_container','display','none'); | |
|
1071 | }); | |
|
1072 | 1072 | |
|
1073 | 1073 | return myCodeMirror |
|
1074 | 1074 | }; |
|
1075 | 1075 | |
|
1076 | 1076 | var setCodeMirrorMode = function(codeMirrorInstance, mode) { |
|
1077 | codeMirrorInstance.setOption("mode", mode); | |
|
1078 | CodeMirror.autoLoadMode(codeMirrorInstance, mode); | |
|
1077 | codeMirrorInstance.setOption("mode", mode); | |
|
1078 | CodeMirror.autoLoadMode(codeMirrorInstance, mode); | |
|
1079 | 1079 | } |
|
1080 | 1080 | |
|
1081 | 1081 | |
@@ -1087,14 +1087,14 b' var getIdentNode = function(n){' | |||
|
1087 | 1087 | } |
|
1088 | 1088 | |
|
1089 | 1089 | if(typeof n.id != "undefined" && n.id.match('L[0-9]+')){ |
|
1090 |
|
|
|
1091 |
|
|
|
1090 | return n | |
|
1091 | } | |
|
1092 | 1092 | else{ |
|
1093 | 1093 | return getIdentNode(n.parentNode); |
|
1094 | 1094 | } |
|
1095 | 1095 | }; |
|
1096 | 1096 | |
|
1097 |
var |
|
|
1097 | var getSelectionLink = function(e) { | |
|
1098 | 1098 | //get selection from start/to nodes |
|
1099 | 1099 | if (typeof window.getSelection != "undefined") { |
|
1100 | 1100 | s = window.getSelection(); |
@@ -1206,8 +1206,8 b' var MembersAutoComplete = function (divi' | |||
|
1206 | 1206 | if (((contact.fname+"").toLowerCase().indexOf(query) > -1) || |
|
1207 | 1207 | ((contact.lname+"").toLowerCase().indexOf(query) > -1) || |
|
1208 | 1208 | ((contact.nname) && ((contact.nname).toLowerCase().indexOf(query) > -1))) { |
|
1209 |
|
|
|
1210 |
|
|
|
1209 | matches[matches.length] = contact; | |
|
1210 | } | |
|
1211 | 1211 | } |
|
1212 | 1212 | return matches; |
|
1213 | 1213 | }; |
@@ -1586,12 +1586,12 b' var removeReviewMember = function(review' | |||
|
1586 | 1586 | |
|
1587 | 1587 | var updateReviewers = function(reviewers_ids, repo_name, pull_request_id){ |
|
1588 | 1588 | if (reviewers_ids === undefined){ |
|
1589 | var reviewers_ids = []; | |
|
1590 | var ids = YUQ('#review_members input'); | |
|
1591 | for(var i=0; i<ids.length;i++){ | |
|
1592 | var id = ids[i].value | |
|
1593 | reviewers_ids.push(id); | |
|
1594 | } | |
|
1589 | var reviewers_ids = []; | |
|
1590 | var ids = YUQ('#review_members input'); | |
|
1591 | for(var i=0; i<ids.length;i++){ | |
|
1592 | var id = ids[i].value | |
|
1593 | reviewers_ids.push(id); | |
|
1594 | } | |
|
1595 | 1595 | } |
|
1596 | 1596 | var url = pyroutes.url('pullrequest_update', {"repo_name":repo_name, |
|
1597 | 1597 | "pull_request_id": pull_request_id}); |
@@ -1621,8 +1621,8 b' var PullRequestAutoComplete = function (' | |||
|
1621 | 1621 | if (((contact.fname+"").toLowerCase().indexOf(query) > -1) || |
|
1622 | 1622 | ((contact.lname+"").toLowerCase().indexOf(query) > -1) || |
|
1623 | 1623 | ((contact.nname) && ((contact.nname).toLowerCase().indexOf(query) > -1))) { |
|
1624 |
|
|
|
1625 |
|
|
|
1624 | matches[matches.length] = contact; | |
|
1625 | } | |
|
1626 | 1626 | } |
|
1627 | 1627 | return matches; |
|
1628 | 1628 | }; |
@@ -1778,9 +1778,9 b' var quick_repo_menu = function(){' | |||
|
1778 | 1778 | |
|
1779 | 1779 | // returns a node from given html; |
|
1780 | 1780 | var fromHTML = function(html){ |
|
1781 |
|
|
|
1782 |
|
|
|
1783 |
|
|
|
1781 | var _html = document.createElement('element'); | |
|
1782 | _html.innerHTML = html; | |
|
1783 | return _html; | |
|
1784 | 1784 | } |
|
1785 | 1785 | |
|
1786 | 1786 | var get_rev = function(node){ |
@@ -1801,16 +1801,16 b' var get_date = function(node){' | |||
|
1801 | 1801 | } |
|
1802 | 1802 | |
|
1803 | 1803 | var revisionSort = function(a, b, desc, field) { |
|
1804 |
|
|
|
1805 |
|
|
|
1804 | var a_ = fromHTML(a.getData(field)); | |
|
1805 | var b_ = fromHTML(b.getData(field)); | |
|
1806 | 1806 | |
|
1807 |
|
|
|
1808 |
|
|
|
1809 |
|
|
|
1807 | // extract revisions from string nodes | |
|
1808 | a_ = get_rev(a_) | |
|
1809 | b_ = get_rev(b_) | |
|
1810 | 1810 | |
|
1811 |
|
|
|
1812 |
|
|
|
1813 |
|
|
|
1811 | var comp = YAHOO.util.Sort.compare; | |
|
1812 | var compState = comp(a_, b_, desc); | |
|
1813 | return compState; | |
|
1814 | 1814 | }; |
|
1815 | 1815 | |
|
1816 | 1816 | var ageSort = function(a, b, desc, field) { |
@@ -1861,19 +1861,19 b' var addPermAction = function(_html, user' | |||
|
1861 | 1861 | var elmts = YUD.getElementsByClassName('last_new_member'); |
|
1862 | 1862 | var last_node = elmts[elmts.length-1]; |
|
1863 | 1863 | if (last_node){ |
|
1864 | var next_id = (YUD.getElementsByClassName('new_members')).length; | |
|
1865 | _html = _html.format(next_id); | |
|
1866 | last_node.innerHTML = _html; | |
|
1867 | YUD.setStyle(last_node, 'display', ''); | |
|
1868 | YUD.removeClass(last_node, 'last_new_member'); | |
|
1869 | MembersAutoComplete("perm_new_member_name_"+next_id, | |
|
1870 | "perm_container_"+next_id, users_list, groups_list); | |
|
1871 | //create new last NODE | |
|
1872 | var el = document.createElement('tr'); | |
|
1873 | el.id = 'add_perm_input'; | |
|
1874 | YUD.addClass(el,'last_new_member'); | |
|
1875 | YUD.addClass(el,'new_members'); | |
|
1876 | YUD.insertAfter(el, last_node); | |
|
1864 | var next_id = (YUD.getElementsByClassName('new_members')).length; | |
|
1865 | _html = _html.format(next_id); | |
|
1866 | last_node.innerHTML = _html; | |
|
1867 | YUD.setStyle(last_node, 'display', ''); | |
|
1868 | YUD.removeClass(last_node, 'last_new_member'); | |
|
1869 | MembersAutoComplete("perm_new_member_name_"+next_id, | |
|
1870 | "perm_container_"+next_id, users_list, groups_list); | |
|
1871 | //create new last NODE | |
|
1872 | var el = document.createElement('tr'); | |
|
1873 | el.id = 'add_perm_input'; | |
|
1874 | YUD.addClass(el,'last_new_member'); | |
|
1875 | YUD.addClass(el,'new_members'); | |
|
1876 | YUD.insertAfter(el, last_node); | |
|
1877 | 1877 | } |
|
1878 | 1878 | } |
|
1879 | 1879 |
General Comments 0
You need to be logged in to leave comments.
Login now