Render settings related JS from the settings blueprint.

This commit is contained in:
Dave Page 2015-02-12 10:57:09 +00:00
parent 4c29f4385f
commit dbd7974e2a
4 changed files with 18 additions and 4 deletions

View File

@ -0,0 +1,17 @@
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2014, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""Browser integration functions for settings."""
from flask import render_template
def get_javascript_code():
"""Render from the template and return any Javascript code snippets required
in the browser"""
return render_template("settings/browser.js")

View File

@ -17,7 +17,7 @@ from flask.ext.security import login_required
from . import get_setting, store_setting
# Initialise the module
blueprint = Blueprint(MODULE_NAME, __name__, url_prefix='/' + MODULE_NAME)
blueprint = Blueprint(MODULE_NAME, __name__, template_folder='templates', url_prefix='/' + MODULE_NAME)
@blueprint.route("/store", methods=['POST'])
@blueprint.route("/store/<setting>/<value>", methods=['GET'])

View File

@ -42,9 +42,6 @@
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/vendor/jquery-ui/jquery-ui.js') }}">{% else %}<script src="{{ url_for('static', filename='js/vendor/jquery-ui/jquery-ui.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/vendor/jquery-layout/jquery.layout.js') }}">{% else %}<script src="{{ url_for('static', filename='js/vendor/jquery-layout/jquery.layout.min.js') }}">{% endif %}</script>
<script src="{{ url_for('static', filename='js/vendor/jquery-layout/plugins/jquery.layout.state.js') }}"></script>
<script>
{% include "js/settings.js" %}
</script>
<script>
alertify.defaults.transition = "zoom";