PageSourceSearch

http://dstyle0210.github.io/sitemap/ang/js/app/ctrl/officialCtrl.js

js dstyle0210.github.io collected 2026-10-03 09:05:10 UTC 2,267 bytes, 66 lines download raw bytes

1app.controller("officialCtrl",function($scope,siteQuery,domQuery,masonryQuery) {
2    var URL = officialListUrl;
3    var formURL = officialFormUrl;
4    var dom = domQuery.getDom("#officialCtrl"); // 컨트롤러 하부 DOM구조 로딩.
5    $scope.tags = _.filter(tagsData,function(tagJson){ return tagJson.type == "official";}); // 입력을 위한 태그목록.
6
7    dom.loading(); // 로딩중~
8    siteQuery.getData(URL,function(cells){
9        $scope.sites = cells; // 사이트 리스트 정보 전달
10        dom.loaded(); // 로딩 종료~
11        masonryQuery.setOption(dom.list); // 미쏘니 레이아웃 적용.
12    });
13
14    $scope.changeVal = function(){ // 정렬내용 바꾸면 실행.
15        masonryQuery.change(dom.list); // 데이터가 바뀌니 masonry도 재로딩
16    };
17
18    $scope.$watch("sites",function(){ // 사이트가 바뀌면 실행
19        if($scope.sites){
20            masonryQuery.watch(dom.list); // 데이터를 지우고 새로쓰는 상황으로 적용.
21        };
22    });
23
24    $scope.refresh = function(){ // 사이트 리스트 재로딩.
25        dom.loading(); // 로딩중~
26        siteQuery.getData(URL,function(cells) {
27            $scope.sites = cells; // 데이터 새로 로딩함.
28            dom.loaded(); // 로딩 종료~
29        });
30    };
31
32
33
34    // 업데이트 요청
35    $scope.update = function(){
36        var data = {
37            name:$scope.name,
38            url:$scope.url,
39            desc:$scope.desc,
40            regname:$scope.regname,
41            regemail:$scope.regemail
42        };
43
44        var tagChecked = dom.ctrl.find("form input[type='checkbox']:checked");
45        data.tag = (_.map(tagChecked,function(inp){return $(inp).val()})).join(",");
46
47        $.ajax({
48            url: formURL,
49            data: data,
50            type: "POST",
51            success: function(response) {
52                $scope.refresh();
53                $scope.name = "";
54                $scope.url = "";
55                $scope.desc = "";
56                $scope.regname = "";
57                $scope.regemail = "";
58                dom.ctrl.find("form input[type='checkbox']").removeAttr("checked");
59            }.bind(this),
60            error: function(xhr, status, err) {
61
62            }.bind(this)
63        });
64
65    };
66});

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.