Commits

Simon Meers  committed 6d76670

A few updates.

  • Participants
  • Parent commits 0fa8b0b

Comments (0)

Files changed (4)

+Fairly immature project, needs a lot of work.
+
+Installation notes to self:
+- url(r'^hyperlinks/', include('hyperlinks.urls')),
+- 'hyperlinks.middleware.HyperlinksMiddleware'
+- HYPERLINKS_USE_MODELS = True # if you want ExternalLink
+- HYPERLINKS_CLASSES = (
+    'hyperlinks.examples.BibleVerse',
+    'hyperlinks.examples.ExternalLink',
+    'content.links.PageLink',
+    )
+- FEINCMS_RICHTEXT_INIT_TEMPLATE = \
+    'hyperlinks/feincms/richtext/init_tinymce.html'

File hyperlinks/templates/hyperlinks/django_hyperlinks.js

                     }
                     else return;
                 }
-                
+
                 ed.windowManager.open({
                     file : popup_url,
                     width : 480,
                     height : 400,
                     inline : 1
                 }, {
-//                    plugin_url : url
+//                    plugin_url : '{% url django_hyperlinks_tinymce.js %}'
                 });
             });
 
 
             ed.addShortcut('ctrl+k', 'Add/Edit link',
                            'mceDjangoHyperlinks');
-            
+
             ed.onNodeChange.add(function(ed, cm, n, co) {
                 cm.setDisabled('link', co && n.nodeName != 'A');
                 cm.setActive('link', n.nodeName == 'A' && !n.name);
 		            title : 'Insert link',
 		            onselect : function(v) {
                         tinyMCE.execCommand('mceDjangoHyperlinks', false, v);
-                        return false; // return to title 
+                        return false; // return to title
 		            }
 		        });
-                {% get_hyperlink_classes as linkclasses %}		        
+                {% get_hyperlink_classes as linkclasses %}
                 {% for linkclass in linkclasses %}
-		        linkbox.add('{{ linkclass.get_name }}', 
+		        linkbox.add('{{ linkclass.get_name }}',
                             '{{ linkclass.class_name }}');
 		        {% endfor %}
 		        return linkbox;
     });
 
     // Register plugin
-    tinymce.PluginManager.add('django_hyperlinks', 
+    tinymce.PluginManager.add('django_hyperlinks',
                               tinymce.plugins.DjangoHyperlinksPlugin);
 })();
 

File hyperlinks/templates/hyperlinks/feincms/richtext/init_tinymce.html

+{% extends "admin/content/richtext/init_tinymce.html" %}
+{# FeinCMS built-in RichTextContent compatibility #}
+{% block tinymce_script %}
+  {{ block.super }}
+  <script type="text/javascript">
+    {% include "hyperlinks/django_hyperlinks.js" %}
+  </script>
+{% endblock %}
+{% block buttons1 %}fullscreen,|,formatselect,|,bold,italic,|,sub,sup,|,bullist,numlist,|,anchor,link,unlink,linkbox,|,code{% endblock %}
+{% block plugins %}{{ block.super }},django_hyperlinks{% endblock %}

File hyperlinks/templates/hyperlinks/popup_base.html

-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <title>Insert Link</title>
-  <script type="text/javascript" src="{{ TINYMCE_JS_ROOT }}tiny_mce_popup.js"></script>
-  <script type="text/javascript" src="{{ TINYMCE_JS_ROOT }}utils/mctabs.js"></script>
-  <script type="text/javascript" src="{{ TINYMCE_JS_ROOT }}utils/form_utils.js"></script>
-  <script type="text/javascript" src="{{ TINYMCE_JS_ROOT }}utils/validate.js"></script>
-  <style type="text/css">
-th{ text-align: right; background-color: #CCC; padding: 0px 5px; }
-th,td{ border-bottom: 1px solid #CCC; }
-    </style>
-</head>
-
-<body>
-<div id="class_choice">
-  Insert link to... 
-  {% for class in subclasses %}
-  <a href="{% url hyperlinks.views.get_form class.class_name %}">[ {{ class.get_name }} ]</a>
-  {% endfor %}
-</div>
-
-  {% block body %}
-  {% endblock %}
-  <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" style="float:right;"/>
-</body>
+<!doctype html>
+<html>
+	<head>
+		<title>Insert Link</title>
+		<script src="{{ TINYMCE_JS_ROOT }}tiny_mce_popup.js"></script>
+		<script src="{{ TINYMCE_JS_ROOT }}utils/mctabs.js"></script>
+		<script src="{{ TINYMCE_JS_ROOT }}utils/form_utils.js"></script>
+		<script src="{{ TINYMCE_JS_ROOT }}utils/validate.js"></script>
+		<style>
+			th{ text-align: right; background-color: #CCC; padding: 0px 5px; }
+			th,td{ border-bottom: 1px solid #CCC; }
+		</style>
+	</head>
+	<body>
+		<div id="class_choice">
+			Insert link to...
+			{% for class in subclasses %}
+				<a href="{% url hyperlinks.views.get_form class.class_name %}">[ {{ class.get_name }} ]</a>
+			{% endfor %}
+		</div>
+		{% block body %}
+		{% endblock %}
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" style="float:right;"/>
+	</body>
 </html>