Commits

Luke Plant committed 71e22c3

s/extract_headings/extract_structure/g

Comments (0)

Files changed (5)

semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

 PresentationControls.prototype.refresh_headings = function() {
     var self = this;
     var html = this.wym.xhtml();
-    jQuery.post(this.opts.extract_headings_url, { 'html':html },
+    jQuery.post(this.opts.extract_structure_url, { 'html':html },
 	function(data) {
 	    self.with_good_data(data, function(value) {
 		self.stored_headings = value;

semanticeditor/templates/semanticeditor/editorwidget.html

 
             // Enable the 'semantic' plugin
             symanticopts = {
-                extract_headings_url: "{% url semantic.extract_headings %}",
+                extract_structure_url: "{% url semantic.extract_structure %}",
                 retrieve_styles_url: "{% url semantic.retrieve_styles %}",
                 separate_presentation_url: "{% url semantic.separate_presentation %}",
                 combine_presentation_url: "{% url semantic.combine_presentation %}",

semanticeditor/urls.py

 from django.conf.urls.defaults import patterns, url
-from semanticeditor.views import extract_headings_view, retrieve_styles, separate_presentation, combine_presentation, preview
+from semanticeditor.views import extract_structure_view, retrieve_styles, separate_presentation, combine_presentation, preview
 
 urlpatterns = patterns('',
-    url(r'extract_headings/', extract_headings_view, name="semantic.extract_headings"),
+    url(r'extract_structure/', extract_structure_view, name="semantic.extract_structure"),
     url(r'retrieve_styles/', retrieve_styles, name="semantic.retrieve_styles"),
     url(r'separate_presentation/', separate_presentation, name="semantic.separate_presentation"),
     url(r'combine_presentation/', combine_presentation, name="semantic.combine_presentation"),

semanticeditor/utils/presentation.py

 
 ## Main functions and sub functions
 
-def extract_headings(content):
+def extract_structure(content):
     """
     Extracts H1, H2, etc headings, and other block level elements and
     returns a list of tuples containing (level, name, tag)

semanticeditor/views.py

 from django.utils import simplejson
 from django.core.mail import mail_admins
 from django.utils.translation import ugettext as _
-from semanticeditor.utils import extract_headings, extract_presentation, format_html, preview_html, AllUserErrors, NEWROW, NEWCOL, PresentationInfo, PresentationClass
+from semanticeditor.utils import extract_structure, extract_presentation, format_html, preview_html, AllUserErrors, NEWROW, NEWCOL, PresentationInfo, PresentationClass
 from semanticeditor.models import CssClass
 import sys
 try:
     return success(val)
 
 @json_view
-def extract_headings_view(request):
+def extract_structure_view(request):
     data = request.POST.get('html','').encode("utf-8")
-    return graceful_errors(AllUserErrors, lambda: extract_headings(data))
+    return graceful_errors(AllUserErrors, lambda: extract_structure(data))
 
 def PI_to_dict(pi):
     """