Repository: oppia/oppia

Issue:
Prevent more than one modal from opening even if the "Save Draft" button is clicked twice
```
What steps will reproduce the problem?
1. Press save. and before the window pops up, press save again. (This happens 
because I do not know if it got pressed, so I clicked again).
2. 2 Save windows will pop up.
3.

What is the expected output? What do you see instead?
I will visually see that I have clicked on the Save Draft button so that I 
don't press twice. Also, I would expect that pressing save twice would still 
only bring up the first window.

What operating system are you using?
Yosemite 10.10.3


Please provide any additional information below.


```

Original issue reported on code.google.com by `sba...@google.com` on 16 May 2015 at 3:02

Prevent more than one modal from opening even if the "Save Draft" button is clicked twice
```
What steps will reproduce the problem?
1. Press save. and before the window pops up, press save again. (This happens 
because I do not know if it got pressed, so I clicked again).
2. 2 Save windows will pop up.
3.

What is the expected output? What do you see instead?
I will visually see that I have clicked on the Save Draft button so that I 
don't press twice. Also, I would expect that pressing save twice would still 
only bring up the first window.

What operating system are you using?
Yosemite 10.10.3


Please provide any additional information below.


```

Original issue reported on code.google.com by `sba...@google.com` on 16 May 2015 at 3:02



Discussion:
```
Note that the relevant code is in:

    core/templates/dev/head/editor/exploration_editor.html
    core/templates/dev/head/editor/ExplorationEditor.js

Thanks!
```

Original comment by `s...@seanlip.org` on 29 May 2015 at 9:29

```
Note that the relevant code is in:

    core/templates/dev/head/editor/exploration_editor.html
    core/templates/dev/head/editor/ExplorationEditor.js

Thanks!
```

Original comment by `s...@seanlip.org` on 29 May 2015 at 9:29


Resolving patch:
diff --git a/core/controllers/base.py b/core/controllers/base.py
--- a/core/controllers/base.py
+++ b/core/controllers/base.py
@@ -55,8 +55,21 @@
     'Text used to encrypt CSRF tokens.', DEFAULT_CSRF_SECRET)
 
 BEFORE_END_HEAD_TAG_HOOK = config_domain.ConfigProperty(
-    'before_end_head_tag_hook', {'type': 'unicode'},
+    'before_end_head_tag_hook', {
+        'type': 'unicode',
+        'ui_config': {
+            'rows': 7,
+        },
+    },
     'Code to insert just before the closing </head> tag in all pages.', '')
+BEFORE_END_BODY_TAG_HOOK = config_domain.ConfigProperty(
+    'before_end_body_tag_hook', {
+        'type': 'unicode',
+        'ui_config': {
+            'rows': 7,
+        },
+    },
+    'Code to insert just before the closing </body> tag in all pages.', '')
 
 OBJECT_EDITORS_JS = config_domain.ComputedProperty(
     'object_editors_js', {'type': 'unicode'},
@@ -369,6 +382,8 @@ def render_template(
             'ALL_LANGUAGE_CODES': feconf.ALL_LANGUAGE_CODES,
             'BEFORE_END_HEAD_TAG_HOOK': jinja2.utils.Markup(
                 BEFORE_END_HEAD_TAG_HOOK.value),
+            'BEFORE_END_BODY_TAG_HOOK': jinja2.utils.Markup(
+                BEFORE_END_BODY_TAG_HOOK.value),
             'DEFAULT_LANGUAGE_CODE': feconf.ALL_LANGUAGE_CODES[0]['code'],
             'DEV_MODE': feconf.DEV_MODE,
             'DOMAIN_URL': '%s://%s' % (scheme, netloc),


Test patch: