From 9145bda0cf0ffa71371afe09a33426a0fb0bdcd5 Mon Sep 17 00:00:00 2001
From: shreypasari-accolite <shrey.pasari@accoliteindia.com>
Date: Tue, 2 Apr 2019 11:19:14 +0530
Subject: [PATCH 1/2] Update to v.3

---
 README.md                | 19 -------------------
 froala_editor/fields.py  |  5 ++---
 froala_editor/widgets.py | 11 ++---------
 setup.py                 |  2 +-
 4 files changed, 5 insertions(+), 32 deletions(-)

diff --git a/README.md b/README.md
index a467a04c..b9e20a19 100644
--- a/README.md
+++ b/README.md
@@ -54,21 +54,6 @@ When used outside the Django admin, the media files are to be manually included
 {{ form.media }}
 ```
 
-In case of jQuery conflict (when your project template already has jQuery), you need to include the following files instead of `{{ form.media }}` plus the static files for theme (if not default) and required plugins.
-
-```python
-<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css" media="all" rel="stylesheet" />
-<link href="{{STATIC_URL}}froala_editor/css/froala_editor.min.css" type="text/css" media="all" rel="stylesheet" />
-<link href="{{STATIC_URL}}froala_editor/css/froala_style.min.css" type="text/css" media="all" rel="stylesheet" />
-<script type="text/javascript" src="{{STATIC_URL}}froala_editor/js/froala_editor.min.js"></script>
-```
-
-Or simply, you may use the following in your `settings.py` if you don't want Froala to include jQuery by itself, thus preventing any conflicts:
-
-```python
-FROALA_INCLUDE_JQUERY = False
-```
-
 ### Options
 
 Froala Editor provides several options for customizing the editor. See [https://froala.com/wysiwyg-editor/docs](https://froala.com/wysiwyg-editor/docs) for all available options.
@@ -153,10 +138,6 @@ Use your key for SCAYT Web SpellChecker with `SCAYT_CUSTOMER_ID` in your project
 
 You can use `FROALA_UPLOAD_PATH` setting in `settings.py` to change the path where uploaded files are stored within the `MEDIA_ROOT`. By default, `uploads/froala_editor/images` is used for storing uploaded images.
 
-### Include jQuery
-
-jQuery is included by default in form media. If you don't want to include jQuery, you may pass `include_jquery=False` to `FroalaEditor` or `FroalaField`. `FROALA_INCLUDE_JQUERY` can be also set in `settings.py` for project wide effects.
-
 ### Other Settings
 
 `USE_FROALA_EDITOR` - default True  
diff --git a/froala_editor/fields.py b/froala_editor/fields.py
index f223479c..a1cc4cf0 100644
--- a/froala_editor/fields.py
+++ b/froala_editor/fields.py
@@ -15,10 +15,9 @@ def __init__(self, *args, **kwargs):
         self.theme = kwargs.pop('theme', getattr(settings, 'FROALA_EDITOR_THEME', None))
         self.plugins = kwargs.pop('plugins', getattr(settings, 'FROALA_EDITOR_PLUGINS', PLUGINS))
         self.third_party = kwargs.pop('plugins', getattr(settings, 'FROALA_EDITOR_THIRD_PARTY', THIRD_PARTY))
-        self.include_jquery = kwargs.pop('include_jquery', getattr(settings, 'FROALA_INCLUDE_JQUERY', True))
         self.image_upload = kwargs.pop('image_upload', True)
         self.file_upload = kwargs.pop('file_upload', True)
-        self.use_froala = kwargs.pop('include_jquery', getattr(settings, 'USE_FROALA_EDITOR', True))
+        self.use_froala = kwargs.pop('', getattr(settings, 'USE_FROALA_EDITOR', True))
         super(FroalaField, self).__init__(*args, **kwargs)
 
     def get_internal_type(self):
@@ -27,7 +26,7 @@ def get_internal_type(self):
     def formfield(self, **kwargs):
         if self.use_froala:
             widget = FroalaEditor(options=self.options, theme=self.theme, plugins=self.plugins,
-                                  include_jquery=self.include_jquery, image_upload=self.image_upload,
+                                  image_upload=self.image_upload,
                                   file_upload=self.file_upload, third_party=self.third_party)
         else:
             widget = Textarea()
diff --git a/froala_editor/widgets.py b/froala_editor/widgets.py
index e8061634..3e1893e9 100644
--- a/froala_editor/widgets.py
+++ b/froala_editor/widgets.py
@@ -16,7 +16,6 @@ def __init__(self, *args, **kwargs):
         self.plugins = kwargs.pop('plugins', getattr(settings, 'FROALA_EDITOR_PLUGINS', PLUGINS))
         self.third_party = kwargs.pop('third_party', getattr(settings, 'FROALA_EDITOR_THIRD_PARTY', THIRD_PARTY))
         self.theme = kwargs.pop('theme', getattr(settings, 'FROALA_EDITOR_THEME', None))
-        self.include_jquery = kwargs.pop('include_jquery', getattr(settings, 'FROALA_INCLUDE_JQUERY', True))
         self.image_upload = kwargs.pop('image_upload', True)
         self.file_upload = kwargs.pop('file_upload', True)
         self.language = (getattr(settings, 'FROALA_EDITOR_OPTIONS', {})).get('language', '')
@@ -71,23 +70,17 @@ def trigger_froala(self, el_id, options):
 
         str = """
         <script>
-            $(function(){
-                $('#%s').froalaEditor(%s)
-            });
+            new FroalaEditor('#%s',%s)
         </script>""" % (el_id, options)
         return str
 
     def _media(self):
         css = {
-            'all': ('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css',
-                    'froala_editor/css/froala_editor.min.css', 'froala_editor/css/froala_style.min.css',
+            'all': ('froala_editor/css/froala_editor.min.css', 'froala_editor/css/froala_style.min.css',
                     'froala_editor/css/froala-django.css')
         }
         js = ('froala_editor/js/froala_editor.min.js', 'froala_editor/js/froala-django.js',)
 
-        if self.include_jquery:
-            js = ('https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js',) + js
-
         if self.theme:
             css['all'] += ('froala_editor/css/themes/' + self.theme + '.min.css',)
 
diff --git a/setup.py b/setup.py
index f0cc40e4..7ce0578f 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 
 setup(
     name='django-froala-editor',
-    version='2.9.3',
+    version='3.0.0-beta.1',
     author='Dipesh Acharya',
     author_email='dipesh@awecode.com',
     maintainer='Froala Labs',

From 781c93f66813d6c83619313281f892aa605ce3f3 Mon Sep 17 00:00:00 2001
From: shreypasari-accolite <shrey.pasari@accoliteindia.com>
Date: Tue, 2 Apr 2019 12:23:01 +0530
Subject: [PATCH 2/2] Remove jquery

---
 froala_editor/static/froala_editor/js/froala-django.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/froala_editor/static/froala_editor/js/froala-django.js b/froala_editor/static/froala_editor/js/froala-django.js
index 986edcf8..53b165aa 100644
--- a/froala_editor/static/froala_editor/js/froala-django.js
+++ b/froala_editor/static/froala_editor/js/froala-django.js
@@ -3,7 +3,7 @@ function getCookie(name) {
   if (document.cookie && document.cookie != '') {
     var cookies = document.cookie.split(';');
     for (var i = 0; i < cookies.length; i++) {
-      var cookie = jQuery.trim(cookies[i]);
+      var cookie = cookies[i].trim();
       // Does this cookie string begin with the name we want?
       if (cookie.substring(0, name.length + 1) == (name + '=')) {
         cookieValue = decodeURIComponent(cookie.substring(name.length + 1));