1app.directive("communityreply", function ($compile) { 2 return { 3 restrict: "E", 4 template: "<a href='#' add-community-reply>Add Reply</href>" 5 }; 6}); 7 8//TODO: rewrite directive to utilize a proper template and controller 9app.directive("addCommunityReply", function ($compile) { 10 return { 11 transclude: false, 12 scope: false, 13 link: function (scope, element, attrs) { 14 element.bind("click", function () { 15 scope.count++; 16 scope.CommunityPost = {}; 17 18 if (!$('#newPost').length) { 19 angular.element($('.newPostContainer')).append($compile( 20 '<div id="newPost" class="panel panel-default">' + 21 '<div class="panel-body">' + 22 '<form role="actionForm" ng-submit="AddNewComment(newCommentForm)">' + 23 '<div class="form-group">' + 24 '<label for="description">Comment</label>' + 25 '<div editor ng-model="CommunityPost.Comment"></div>' + 26 '<!--<textarea class="form-control" ng-model="CommunityPost.Comment" rows="5" style="resize:vertical;"></textarea>-->' + 27 '<!--<input type="email" class="form-control" id="email" placeholder="Enter email" />-->' + 28 '</div>' + 29 '<div>' + 30 '<div ngf-drop="addFiles($files)" ngf-select="addFiles($files)" class="drop-box"' + 31 'ngf-drag-over-class="dragover" ngf-multiple="true" ngf-allow-dir="true" ngf-max-size="25MB">' + 32 '<i class="fa fa-cloud-upload fa-4x" style="color:#3D6DA7"></i><br />' + 33 '<label>Drop files here or click to upload</label><br />' + 34 '<small>Images can be pasted into the description as well</small><br />' + 35 '</div>' + 36 '<ul class="list-group">' + 37 '<li class="list-group-item" ng-repeat="f in files">{{f.name}}<a ng-click="deleteFile($index)" class="pull-right"><i class="fa fa-trash"></i></a></li>' + 38 '</ul>' + 39 '<div ngf-no-file-drop>File Drag/Drop is not supported for this browser</div>' + 40 '{{errorMsg}}' + 41 '</div>' + 42 '<div class="text-right">' + 43 '<button type="button" class="btn btn-danger" ng-click="cancelCommunityPost()" aria-hidden="true">Cancel</button>' + 44 ' <button type="submit" class="btn btn-primary" ng-click="submitCommunityPost()">Submit</button>' + 45 '</div>' + 46 '</form>' + 47 '</div>' + 48 '</div>')(scope)); 49 } 50 $('body, html').animate({ scrollTop: $("#newPost").offset().top }, 1000); 51 }); 52 53 scope.cancelCommunityPost = function () { 54 $('#newPost').slideUp(400, function () { 55 $('.newPostContainer').empty(); 56 }); 57 }; 58 59 scope.submitCommunityPost = function () { 60 scope.saveCommunityPost(scope.CommunityPost.Comment, function () { 61 $('#newPost').slideUp(400, function () { 62 $('.newPostContainer').empty(); 63 }); 64 }); 65 }; 66 67 scope.$watch(attrs.visible, function (value) { 68 if (value === true) 69 $(element).modal('show'); 70 else 71 $(element).modal('hide'); 72 }); 73 } 74 }; 75});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.