~dylanmccall/harvest/gsoc-client-stuff

« back to all changes in this revision

Viewing changes to harvest/filters/filters.py

  • Committer: Dylan McCall
  • Date: 2010-07-04 04:18:40 UTC
  • Revision ID: dylanmccall@gmail.com-20100704041840-hqfrpzjcohh15qz2
Some cleanup and Javascript tricks.

Implemented JQuery PlaceHeld plugin to support placeholder text in browsers that don't do it natively.

filters.js:
Code cleanup.
Implemented some signals in Filter "class," so a filter knows when it is enabled.
EditFilter will focus its input field when enabled.
Renamed to harvest.js, for clarity.

filters.py: EditFilter input field is only given a value parameter if value is not empty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
    
228
228
    def render_html_value(self, **kwargs):
229
229
        field_value = self.get_value()
230
 
        return '<input type="text" placeholder="(type here)" spellcheck="false" value="%s" />' % field_value
 
230
        if field_value:
 
231
            field_value = 'value="%s"' % field_value 
 
232
        return '<input type="text" placeholder="(type here)" spellcheck="false" %s />' % field_value
231
233
 
232
234
 
233
235
class SetFilter(Filter): #abstract, extend in application