CouchDB
  1. CouchDB
  2. COUCHDB-632

Generic _changes listener added to jquery.couch.js

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Futon
    • Labels:
      None
    • Environment:

      the Browser!

    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      I've written a Generic _changes listener and added it to jquery.couch.js taken from Futon.

      1. changes1.diff
        5 kB
        Benoit Chesneau
      2. changes.diff
        5 kB
        Chris Anderson
      3. jquery.couch.js
        17 kB
        mikeal

        Activity

        Hide
        Benoit Chesneau added a comment -

        that would be an interesting features indeed. What about the "undefined" stuff that appears from time to time ? Shouldn't it be solved in jquery.couch.js ?

        Show
        Benoit Chesneau added a comment - that would be an interesting features indeed. What about the "undefined" stuff that appears from time to time ? Shouldn't it be solved in jquery.couch.js ?
        Hide
        Chris Anderson added a comment -

        ooh and you could even allow people to specify filters.

        Show
        Chris Anderson added a comment - ooh and you could even allow people to specify filters.
        Hide
        Chris Anderson added a comment -

        If there were a Futon page of the 50 most recent _changes entries as they were being created / edited (using the All Documents ui) people would really appreciate this patch.

        Because that would rule.

        Show
        Chris Anderson added a comment - If there were a Futon page of the 50 most recent _changes entries as they were being created / edited (using the All Documents ui) people would really appreciate this patch. Because that would rule.
        Hide
        Benoit Chesneau added a comment -

        If couchdb stop to get changes we received undefined results and oldest id :

        Got 79ca040d0a6d784619c61b28e00005ff
        Got undefined
        Got 79ca040d0a6d784619c61b28e00005ff

        Here is a quick test.html to reproduce :

        <!DOCTYPE html>
        <html>
        <head>
        <title>Test</title>

        </head>
        <body>
        <h1>Test changes</h1>

        <ul id="lines"></ul>

        </body>
        <script src="/_utils/script/json2.js"></script>
        <script src="/_utils/script/jquery.js?1.3.1"></script>
        <script src="/_utils/script/jquery.couch.js"></script>
        <script>
        var db = $.couch.db("test");
        var changes = db.changes(

        {seq:15}

        )
        changes.addListener(function(data)

        { console.log(data); $("#lines").append("<li> Got " + data.id + "</li>"); }

        );
        changes.start();
        </script>

        </html>

        Show
        Benoit Chesneau added a comment - If couchdb stop to get changes we received undefined results and oldest id : Got 79ca040d0a6d784619c61b28e00005ff Got undefined Got 79ca040d0a6d784619c61b28e00005ff Here is a quick test.html to reproduce : <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <h1>Test changes</h1> <ul id="lines"></ul> </body> <script src="/_utils/script/json2.js"></script> <script src="/_utils/script/jquery.js?1.3.1"></script> <script src="/_utils/script/jquery.couch.js"></script> <script> var db = $.couch.db("test"); var changes = db.changes( {seq:15} ) changes.addListener(function(data) { console.log(data); $("#lines").append("<li> Got " + data.id + "</li>"); } ); changes.start(); </script> </html>
        Hide
        Benoit Chesneau added a comment -
        Show
        Benoit Chesneau added a comment - Updated diff. fix a try catch non closed : http://github.com/benoitc/couchdb/commit/41eafc56799b1516c9a8d2207fa53366787be0bf
        Hide
        Chris Anderson added a comment -

        here's a diff merged to work with latest trunk

        Show
        Chris Anderson added a comment - here's a diff merged to work with latest trunk
        Hide
        mikeal added a comment -

        modified jquery.couch.js , jchris said I should just attach the whole file instead of a diff.

        Show
        mikeal added a comment - modified jquery.couch.js , jchris said I should just attach the whole file instead of a diff.

          People

          • Assignee:
            Unassigned
            Reporter:
            mikeal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development