<commit_before>'use strict';

angular.module('magicBuddy.viewer', [angularDragula(angular)])

.controller('ViewerCtrl', ["$scope", "$sce", function($scope, $sce) {

    $scope.viewerCard = null;
    $scope.symbolRe = /[^{}]+(?=\})/g;
    $scope.viewerMode = "image";

    
    $scope.$on("viewer:showCard", function(e, card){
        $scope.viewerCard = card;
    })

    $scope.$on("viewer:hideCard", function(e){
        $scope.viewerCard = null;
    })

    $scope.manaSymbols = function(){
        var symbols = [];

        $scope.viewerCard.manaCost.match($scope.symbolRe).forEach(function(el){
            symbols.push(el.toLowerCase());
        });

        return symbols
    }

    $scope.getUnderName = function(){
        return encodeURI($scope.viewerCard.name.toLowerCase().replace(/ /g, "_").replace(/\'/g, "").replace(/-/g, "_") + ".jpg");
    }

    $scope.showImage = function(){
        return $scope.viewerMode == "image";
    }

    $scope.showText = function(){
        return $scope.viewerMode == "text";
    }<commit_msg>fix : issue with viewer<commit_after>'use strict';

angular.module('magicBuddy.viewer', [angularDragula(angular)])

.controller('ViewerCtrl', ["$scope", "$sce", function($scope, $sce) {

    $scope.viewerCard = null;
    $scope.symbolRe = /[^{}]+(?=\})/g;
    $scope.viewerMode = "image";

    
    $scope.$on("viewer:showCard", function(e, card){
        $scope.viewerCard = card;
    })

    $scope.$on("viewer:hideCard", function(e){
        $scope.viewerCard = null;
    })

    $scope.manaSymbols = function(){
        var symbols = [];

        $scope.viewerCard.manaCost.match($scope.symbolRe).forEach(function(el){
            symbols.push(el.toLowerCase());
        });

        return symbols
    }

    $scope.getUnderName = function(){
        return encodeURI($scope.viewerCard.name
                .toLowerCase()
                .replace(/ /g, "_")
                .replace(/\'/g, "")
                .replace(/-/g, "_")
                .replace(/:/g, "") + ".jpg");
    }

    $scope.showImage = function(){
        return $scope.viewerMode == "image";
    }

    $scope.showText = function(){
        return $scope.viewerMode == "text";
    }
{'fraction_non_alphanumeric': 0.19428052655469813, 'fraction_numerical': 0.0, 'mean_word_length': 2.44375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '310971', 'n_tokens_mistral': 733, 'n_tokens_neox': 708, 'n_words': 106}