<commit_before>import { ng } from '../ng-start';
import { Me } from '../me';
import http from 'axios';

export let infotip = ng.directive('infotip', () => {
    return {
        restrict: 'E',
        template: `
            <i class="close"></i>
            <div ng-transclude></div>
        `,
        scope: { name: '@' },
        transclude: true,
        link: async (scope, element, attributes) => {
             let infotips = await Me.preference('infotip');
             if(infotips[scope.name] === false){
                 element.remove();
             }

             element.children('i').on('click', () => {
                 element.slideUp();
                 Me.preferences.infotip[scope.name] = false;
                 Me.savePreference('infotip');
             })
        }
    }
})<commit_msg>hide infotip by default<commit_after>import { ng } from '../ng-start';
import { Me } from '../me';
import http from 'axios';

export let infotip = ng.directive('infotip', () => {
    return {
        restrict: 'E',
        template: `
            <i class="close"></i>
            <div ng-transclude></div>
        `,
        scope: { name: '@' },
        transclude: true,
        link: async (scope, element, attributes) => {
             let infotips = await Me.preference('infotip');
             if(infotips[scope.name] === false){
                 element.remove();
             }
             else{
                 element.css({ 'display': 'block' });
             }

             element.children('i').on('click', () => {
                 element.slideUp();
                 Me.preferences.infotip[scope.name] = false;
                 Me.savePreference('infotip');
             })
        }
    }
})
{'fraction_non_alphanumeric': 0.1633720930232558, 'fraction_numerical': 0.0, 'mean_word_length': 1.5160818713450293, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '4911618', 'n_tokens_mistral': 490, 'n_tokens_neox': 487, 'n_words': 97}