Skip to main content

Home/ interesting_sites/ Group items tagged pages

Rss Feed Group items tagged

pagetribe .

Re: [Swftools-common] PDF2SWF and getTextSnapShot() - 0 views

  • that said, here there is my ActionScript code to highlight the text inside a PDF page. It works with Flash 8 or previous ONLY because the new Flash 9 has a different AVM interpreter (AVM2) and many things have changed. Please note: - ``txt`` is the text to search and highlight inside your page - ``mc`` points to _root.text that's where I was keeping my swf/pdf page you should change that so it references yours. Here is the code: function hltext ( txt ) { var mc = _root.text; var my_snap:TextSnapshot = mc.getTextSnapshot(); var start_pos:Number = 0; start_pos = my_snap.findText ( start_pos, txt, false ); while ( start_pos > 0 ) { trace ( start_pos ); my_snap.setSelected( start_pos, start_pos + txt.length, true ); start_pos += txt.length; start_pos = my_snap.findText ( start_pos, txt, false ); } }
  •  
    that said, here there is my ActionScript code to highlight the text inside a PDF page. It works with Flash 8 or previous ONLY because the new Flash 9 has a different AVM interpreter (AVM2) and many things have changed. Please note: - ``txt`` is the text to search and highlight inside your page - ``mc`` points to _root.text that's where I was keeping my swf/pdf page you should change that so it references yours. Here is the code: function hltext ( txt ) { var mc = _root.text; var my_snap:TextSnapshot = mc.getTextSnapshot(); var start_pos:Number = 0; start_pos = my_snap.findText ( start_pos, txt, false ); while ( start_pos > 0 ) { trace ( start_pos ); my_snap.setSelected( start_pos, start_pos + txt.length, true ); start_pos += txt.length; start_pos = my_snap.findText ( start_pos, txt, false ); } }
pagetribe .

Find Anything You Need on jQuery to Become an Almighty Developer | Effectize - 0 views

  •  
    great resource page for jquery
pagetribe .

http://www.quiss.org/swftools/pdf2swf_usage.html - 0 views

  • Embedding the SWF into a html page
  • swfdump --html flashfile.swf
pagetribe .

Activist Toolkit - 0 views

pagetribe .

Chapter 11: Generic Views - 0 views

  • from django.conf.urls.defaults import * from django.views.generic import list_detail from mysite.books.models import Publisher publisher_info = { 'queryset': Publisher.objects.all(), 'template_name': 'publisher_list_page.html', } urlpatterns = patterns('', (r'^publishers/$', list_detail.object_list, publisher_info) )
  • That’s really all there is to it. All the cool features of generic views come from changing the “info” dictionary passed to the generic view.
  • You might have noticed that sample publisher list template stores all the books in a variable named object_list.
  • ...10 more annotations...
  • it isn’t all that “friendly” to template authors: they have to “just know” that they’re dealing with books here.
  • better name
  • publisher_list;
  • 'template_object_name': 'publisher',
  • If you want to present a list of books by a particular publisher, you can use the same technique:
  • Another common need is to filter the objects given in a list page by some key in the URL. Earlier we hard-coded the publisher’s name in the URLconf, but what if we wanted to write a view that displayed all the books by some arbitrary publisher?
  • “wrap” the object_list generic view
  • # Look up the publisher (and raise a 404 if it can't be found). publisher = get_object_or_404(Publisher, name__iexact=name)
  • Notice that in the preceding example we passed the current publisher being displayed in the extra_context. This is usually a good idea in wrappers of this nature; it lets the template know which “parent” object is currently being browsed.
  • Or, you could use a less obvious but shorter version that relies on the fact that Book.objects.all is itself a callable:
1 - 13 of 13
Showing 20 items per page