<commit_before># -*- coding: utf-8 -*-

from floppyforms.widgets import TextInput
from django.utils.encoding import force_unicode
from django.forms import Media
from django.core.urlresolvers import reverse

class AlohaInput(TextInput):
    """
    Text widget with aloha html editor
    requires floppyforms to be installed
    """
    
    template_name='djaloha/alohainput.html'
    
    def __init__(self, *args, **kwargs):
        self._text_color_plugin = kwargs.pop('text_color_plugin', True)
        super(AlohaInput, self).__init__(*args, **kwargs)
    
    def _get_media(self):
        """
        return code for inserting required js and css files
        need aloha , plugins and initialization
        include the 3rd party ImagePlugin from tapo: make possible to drag-and-drop and edit images
        """
        
        css = {
            'all': (
                "aloha.0.20/css/aloha.css",
            )
        }
        
        js = (
            "js/jquery.1.7.2.js",
            # Yes I know this is very dirty but the only solution so-far
            'aloha.0.20/lib/aloha.js" data-aloha-plugins="common/format,common/highlighteditables,common/list,common/link,common/undo,common/paste,common/block',
        )
        
        js = js + (reverse('aloha_init'),)
        
        return Media(css=css, js=js)
    
    media = property(_get_media)<commit_msg>jquery 1.7.2 is not in static<commit_after># -*- coding: utf-8 -*-

from floppyforms.widgets import TextInput
from django.utils.encoding import force_unicode
from django.forms import Media
from django.core.urlresolvers import reverse

class AlohaInput(TextInput):
    """
    Text widget with aloha html editor
    requires floppyforms to be installed
    """

    template_name='djaloha/alohainput.html'

    def __init__(self, *args, **kwargs):
        self._text_color_plugin = kwargs.pop('text_color_plugin', True)
        super(AlohaInput, self).__init__(*args, **kwargs)

    def _get_media(self):
        """
        return code for inserting required js and css files
        need aloha , plugins and initialization
        include the 3rd party ImagePlugin from tapo: make possible to drag-and-drop and edit images
        """

        css = {
            'all': (
                "aloha.0.20/css/aloha.css",
            )
        }

        js = (
            "js/jquery.1.7.1.min.js",
            # Yes I know this is very dirty but the only solution so-far
            'aloha.0.20/lib/aloha.js" data-aloha-plugins="common/format,common/highlighteditables,common/list,common/link,common/undo,common/paste,common/block',
        )

        js = js + (reverse('aloha_init'),)

        return Media(css=css, js=js)

    media = property(_get_media)
{'fraction_non_alphanumeric': 0.10547445255474452, 'fraction_numerical': 0.009124087591240875, 'mean_word_length': 2.3224242424242423, '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': '305472', 'n_tokens_mistral': 859, 'n_tokens_neox': 806, 'n_words': 204}