<commit_before>module = angular.module('map.controllers', ['imageupload'])

class MapDetailCtrl
        constructor: (@$scope, @$routeParams, @MapService, @Map, @geolocation) ->
                @$scope.MapService = @MapService

                # XXX: move that
                @MapService.load("amap")


class MapNewCtrl
        constructor: (@$scope, @Map) ->
                null


class MapMarkerDetailCtrl
        constructor: (@$scope, @$routeParams, @Marker) ->
                @$scope.isLoading = true

                @$scope.marker = @Marker.get({markerId: @$routeParams.markerId}, (aMarker, getResponseHeaders) =>
                        console.debug("marker loaded")
                        @$scope.isLoading = false
                )


class MapMarkerNewCtrl
        constructor: (@$scope, @$rootScope, @debounce, @$location, @MapService, @Marker, @geolocation) ->
                width = 320
                height = 240

                video = document.querySelector("#video")
                """
                video.addEventListener("canplay", ((ev) ->
                         unless streaming
                                 height = video.videoHeight / (video.videoWidth / width)
                                 video.setAttribute("width", width)
                                 video.setAttribute("height", height)
                                 canvas.setAttribute("width", width)
                                 canvas.setAttribute("height", height)
                                 streaming = true
                         ),
                false)
                """

                @$scope.uploads = {}

                # The new marker we'll submit if everything is OK
                @$scope.marker = new @Marker()
                @$scope.marker.position =
                        coordinates: null
                        type: "Point"

                # Preview the nextr marker
                @$scope.marker_preview =
                        draggable: true
                        attrs:
                                icon: L.icon(
                                        iconUrl: '/images/poi_localisation.png'
                                        shadowUrl: null,
                                        iconSize: new L.Point(65, 75)
                                        iconAnchor: new L.Point(4, 37)
                                )

                @MapService.addMarker('marker_preview', @$scope.marker_preview)


                # Geolocation
                # this.geolocateMarker()

                # Wizard Steps
                @$scope.wizardSteps = [
                        "category",
                        "picture",
                        "info",
                        "location"
                ]

                @$scope.wizardStep = @$scope.wizardSteps[0]

                @$scope.captureInProgress = false<commit_msg>by default, place new marker at the center of the view<commit_after>module = angular.module('map.controllers', ['imageupload'])

class MapDetailCtrl
        constructor: (@$scope, @$routeParams, @MapService, @Map, @geolocation) ->
                @$scope.MapService = @MapService

                # XXX: move that
                @MapService.load("amap")


class MapNewCtrl
        constructor: (@$scope, @Map) ->
                null


class MapMarkerDetailCtrl
        constructor: (@$scope, @$routeParams, @Marker) ->
                @$scope.isLoading = true

                @$scope.marker = @Marker.get({markerId: @$routeParams.markerId}, (aMarker, getResponseHeaders) =>
                        console.debug("marker loaded")
                        @$scope.isLoading = false
                )


class MapMarkerNewCtrl
        constructor: (@$scope, @$rootScope, @debounce, @$location, @MapService, @Marker, @geolocation) ->
                width = 320
                height = 240

                video = document.querySelector("#video")
                """
                video.addEventListener("canplay", ((ev) ->
                         unless streaming
                                 height = video.videoHeight / (video.videoWidth / width)
                                 video.setAttribute("width", width)
                                 video.setAttribute("height", height)
                                 canvas.setAttribute("width", width)
                                 canvas.setAttribute("height", height)
                                 streaming = true
                         ),
                false)
                """

                @$scope.uploads = {}

                # The new marker we'll submit if everything is OK
                @$scope.marker = new @Marker()
                @$scope.marker.position =
                        coordinates: null
                        type: "Point"

                # Preview the next marker
                @$scope.marker_preview =
                        draggable: true
                        lat: @MapService.center.lat
                        lng: @MapService.center.lng
                        attrs:
                                icon: L.icon(
                                        iconUrl: '/images/poi_localisation.png'
                                        shadowUrl: null,
                                        iconSize: new L.Point(65, 75)
                                        iconAnchor: new L.Point(4, 37)
                                )

                @MapService.addMarker('marker_preview', @$scope.marker_preview)


                # Geolocation
                # this.geolocateMarker()

                # Wizard Steps
                @$scope.wizardSteps = [
                        "category",
                        "picture",
                        "info",
                        "location"
                ]

                @$scope.wizardStep = @$scope.wizardSteps[0]

                @$scope.captureInProgress = false
{'fraction_non_alphanumeric': 0.09521402089652849, 'fraction_numerical': 0.0047185709470845974, 'mean_word_length': 1.0388182755066988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4021676', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1266, 'n_words': 273}