# -*- coding: utf-8 -*- """ zine.plugins.yui_editor ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2009 by the Aaron VanDerlip, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from os.path import join, dirname from zine.api import url_for, _ from zine.views.admin import render_admin_response from zine.utils.admin import flash from zine.utils import forms from zine.api import * TEMPLATE_FILES = join(dirname(__file__), 'templates') SHARED_FILES = join(dirname(__file__), 'shared') def inject_yui_scripts(req, context): """This is called before the admin response is rendered. We add the fish script and the stylesheet and then we add a new header snippet which basically is some HTML code that is added to the
section. In this header snippet we set the global `$ERIC_THE_FISH_SKIN` variable to the selected skin. """ add_header_snippet( ' ' '' ' ' ' ' ' ' ' ' ' ' '' ' ' '' '''''' ) add_script(url_for('yui_editor/shared', filename='yui_editor.js')) def setup(app, plugin): # we want our yui to appear in the admin panel, so hook into the # correct event. app.connect_event('before-admin-response-rendered', inject_yui_scripts) app.add_shared_exports('yui_editor', SHARED_FILES) app.add_template_searchpath(TEMPLATE_FILES)