]> git.parisson.com Git - telemeta.git/commitdiff
send marker request works
authorriccardo <riccardo@parisson.com>
Mon, 7 Feb 2011 15:54:58 +0000 (16:54 +0100)
committerriccardo <riccardo@parisson.com>
Mon, 7 Feb 2011 15:54:58 +0000 (16:54 +0100)
telemeta/htdocs/timeside/src/controller.js
telemeta/htdocs/timeside/src/core.js
telemeta/htdocs/timeside/src/markermap.js
telemeta/templates/telemeta_default/base.html
telemeta/web/base.py

index e8e41dd5af803bcd89c63d94e10677158213e11c..0ed4989f6d8a774215cc6d3ee6434bec857a5c6f 100644 (file)
@@ -164,52 +164,42 @@ TimeSide(function($N) {
         },
 
         sendHTTP: function(marker){
-            var data2send = {"item_id": itemid, "public_id": marker.id, "time": marker.offset,
-                    "description": marker.desc};
-
+            
             //itemid is the item (spund file) name
             var sPath = window.location.pathname;
             //remove last "/" or last "/#", if any...
             sPath = sPath.replace(/\/#*$/,"");
             var itemid = sPath.substring(sPath.lastIndexOf('/') + 1);
 
+            //WARNING: use single quotes for the whole string!!
+            //see http://stackoverflow.com/questions/4809157/i-need-to-pass-a-json-object-to-a-javascript-ajax-method-for-a-wcf-call-how-can
+            var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ itemid+'", "public_id": "'+marker.id+'", "time": "'+
+            marker.offset+'","description": "'+marker.desc+'"}], "method":"telemeta.add_marker","jsonrpc":"1.0"}';
+
 
-            //don't change the order BELOW unless the relative python code for the server changes as 
-            //well:
-            //var data2send = [itemid, marker.id, marker.offset, marker.desc];
             $.ajax({
                 type: "POST",
-                url: "/json",
-                method: "telemeta.add_marker",
-                data: data2send,
-                dataType: 'text',
-                contentType: 'application/json; charset=utf-8',
-//                success: function(msg){
-//                    alert( "Data Saved: " + msg );
-//                },
-                error: function(msg){
-                    alert("Error: "+msg);
-                    
-                }
-
+                url: 'http://localhost:9000/json/',
+                contentType: "application/json",
+                data: data2send
             });
         },
 
         quote: function(string){
-//            var s = "\"";
-//            var isEscaped = false;
-//            for(var i=0; i<string.length; i++){
-//                var c = string.charAt(i);
-//                if(isEscaped){
-//
-//                }else if(c == "\\"){
-//                    isEscaped = true;
-//                }else{
-//
-//                }
-//                s+=c;
-//            }
-//            s+="\"";
+            //            var s = "\"";
+            //            var isEscaped = false;
+            //            for(var i=0; i<string.length; i++){
+            //                var c = string.charAt(i);
+            //                if(isEscaped){
+            //
+            //                }else if(c == "\\"){
+            //                    isEscaped = true;
+            //                }else{
+            //
+            //                }
+            //                s+=c;
+            //            }
+            //            s+="\"";
             return s;
         }
 
index 3f48121454086bf5a37a8cd12302cf56a39303c3..02c9ab4a6c3984bd7f8f2381dd545cb386e034c0 100644 (file)
 
 TimeSide(function($N, $J) {
 
-$N.extend = function(destination, source) {
-  for (var property in source)
-    destination[property] = source[property];
-  return destination;
-};
-
-$N.objectKeys = function(object) {
-    var keys = [];
-    for (var property in object)
-      keys.push(property);
-    return keys;
-};
-
-$N.argumentNames = function(method) {
-    var names = method.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1]
-      .replace(/\s+/g, '').split(',');
-    return names.length == 1 && !names[0] ? [] : names;
-};  
-
-$N.argsToArray = function(args) {
-    var length = args.length || 0, result = new Array(length);
-    while (length--) result[length] = args[length];
-    return result;
-};
-
-$N.wrapFunction = function(wrapper, method) {
-    return function() {
-      var args = $N.argsToArray(arguments);
-      return wrapper.apply(this, [$N.attachFunction(this, method)].concat(args)); 
-    }
-};
-$N.attachFunction = function() {
-    if (arguments.length < 3 && (typeof arguments[1] == 'undefined')) return arguments[0];
-    var args = $N.argsToArray(arguments);
-    var object = args.shift();
-    var method = args.shift();
-    return function() {
-      var _args = $N.argsToArray(arguments);
-      return method.apply(object, args.concat(_args));
-    }
-};
+    $N.extend = function(destination, source) {
+        for (var property in source){
+            destination[property] = source[property];
+        }
+        return destination;
+    };
 
-$N.attachAsEventListener = function() {
-    var args = $N.argsToArray(arguments), object = args.shift();
-    var method = args.shift();
-    return function(event) {
-      return method.apply(object, [event || window.event].concat(args));
-    }
-};
+    $N.objectKeys = function(object) {
+        var keys = [];
+        for (var property in object){
+            keys.push(property);
+        }
+        return keys;
+    };
+
+    $N.argumentNames = function(method) {
+        var names = method.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1]
+        .replace(/\s+/g, '').split(',');
+        return names.length == 1 && !names[0] ? [] : names;
+    };
+
+    $N.argsToArray = function(args) {
+        var length = args.length || 0, result = new Array(length);
+        while (length--){
+            result[length] = args[length];
+        }
+        return result;
+    };
 
-$N.isInstanceOf = function(obj, className) {
-    if (typeof obj == 'object' && obj.__class__) {
-        var c = obj.__class__;
-        if (c.__name__ == className) {
-            return true;
+    $N.wrapFunction = function(wrapper, method) {
+        return function() {
+            var args = $N.argsToArray(arguments);
+            return wrapper.apply(this, [$N.attachFunction(this, method)].concat(args));
         }
-        while (c = c.__super__) {
+    };
+    $N.attachFunction = function() {
+        if (arguments.length < 3 && (typeof arguments[1] == 'undefined')){
+            return arguments[0];
+        }
+        var args = $N.argsToArray(arguments);
+        var object = args.shift();
+        var method = args.shift();
+        return function() {
+            var _args = $N.argsToArray(arguments);
+            return method.apply(object, args.concat(_args));
+        }
+    };
+
+    $N.attachAsEventListener = function() {
+        var args = $N.argsToArray(arguments), object = args.shift();
+        var method = args.shift();
+        return function(event) {
+            return method.apply(object, [event || window.event].concat(args));
+        }
+    };
+
+    $N.isInstanceOf = function(obj, className) {
+        if (typeof obj == 'object' && obj.__class__) {
+            var c = obj.__class__;
             if (c.__name__ == className) {
                 return true;
             }
+            while (c = c.__super__) {
+                if (c.__name__ == className) {
+                    return true;
+                }
+            }
         }
+        return false;
     }
-    return false;
-}
-
-$N.Class = {
-  create: function() {
-    var parent = null, className = null;
-    var properties = $N.argsToArray(arguments)
-    if (typeof properties[0] == "string")
-      className = properties.shift();
-    if (typeof properties[0] == "function")
-      parent = properties.shift();
+
+    $N.Class = {
+        create: function() {
+            var parent = null, className = null;
+            var properties = $N.argsToArray(arguments)
+            if (typeof properties[0] == "string"){
+                className = properties.shift();
+            }
+            if (typeof properties[0] == "function"){
+                parent = properties.shift();
+            }
     
-    function klass() {
-      this.initialize.apply(this, arguments);
-    }
+            function klass() {
+                this.initialize.apply(this, arguments);
+            }
     
-    $N.extend(klass, $N.Class.Methods);
-    klass.__name__ = className;
-    klass.__super__ = parent;
-    klass.__subclasses__ = [];
+            $N.extend(klass, $N.Class.Methods);
+            klass.__name__ = className;
+            klass.__super__ = parent;
+            klass.__subclasses__ = [];
     
-    if (parent) {
-      var subclass = function() { };
-      subclass.prototype = parent.prototype;
-      klass.prototype = new subclass;
-      parent.__subclasses__.push(klass);
-    }
+            if (parent) {
+                var subclass = function() { };
+                subclass.prototype = parent.prototype;
+                klass.prototype = new subclass;
+                parent.__subclasses__.push(klass);
+            }
     
-    klass.prototype.__class__ = klass;
-    for (var i = 0; i < properties.length; i++)
-      klass.addMethods(properties[i]);
+            klass.prototype.__class__ = klass;
+            for (var i = 0; i < properties.length; i++){
+                klass.addMethods(properties[i]);
+            }
       
-    if (!klass.prototype.initialize)
-      klass.prototype.initialize = function () {};
+            if (!klass.prototype.initialize){
+                klass.prototype.initialize = function () {};
+
+            }
     
-    klass.prototype.constructor = klass;
+            klass.prototype.constructor = klass;
    
-    if (className) {
-        $N[className] = klass;
-    }
-    return klass;
-  }
-};
+            if (className) {
+                $N[className] = klass;
+            }
+            return klass;
+        }
+    };
  
-$N.Class.Methods = {
-  addMethods: function(source) {
-    var ancestor   = this.__super__ && this.__super__.prototype;
-    var properties = $N.objectKeys(source);
+    $N.Class.Methods = {
+        addMethods: function(source) {
+            var ancestor   = this.__super__ && this.__super__.prototype;
+            var properties = $N.objectKeys(source);
     
-    if (!$N.objectKeys({ toString: true }).length)
-      properties.push("toString", "valueOf");
-    
-    for (var i = 0, length = properties.length; i < length; i++) {
-      var property = properties[i], value = source[property];
-      if (ancestor && (typeof value == 'function') &&
-          $N.argumentNames(value)[0] == "$super") {
-        var method = value;
-        value = $N.wrapFunction(method, (function(m) {
-          return function() { return ancestor[m].apply(this, arguments) };
-        })(property));
+            if (!$N.objectKeys({
+                toString: true
+            }).length){
+                properties.push("toString", "valueOf");
+            }
+            for (var i = 0, length = properties.length; i < length; i++) {
+                var property = properties[i], value = source[property];
+                if (ancestor && (typeof value == 'function') &&
+                    $N.argumentNames(value)[0] == "$super") {
+                    var method = value;
+                    value = $N.wrapFunction(method, (function(m) {
+                        return function() {
+                            return ancestor[m].apply(this, arguments)
+                        };
+                    })(property));
  
-        value.valueOf = $N.attachFunction(method, method.valueOf);
-        value.toString = $N.attachFunction(method, method.toString);
-      }
-      this.prototype[property] = value;
-    }
+                    value.valueOf = $N.attachFunction(method, method.valueOf);
+                    value.toString = $N.attachFunction(method, method.toString);
+                }
+                this.prototype[property] = value;
+            }
     
-    return this;
-  }
-};
+            return this;
+        }
+    };
  
-$N.Core = $N.Class.create("Core", {
-    eventContainer: null,
-    eventPrefix: '',
-    cfg: {},
-
-    initialize: function() {
-        this.debug("new instance");
-        $N.registerInstance(this);
-        this.eventContainer = $J('<div/>');
-        this.forwardEvent = this.attach(this._forwardEvent);
-    },
-
-    free: function() {
-        this.eventContainer = null;
-    },
-
-    configure: function(config, defaults) {
-        if (!config)
-            config = {};
-        for (k in defaults) {
-            var value = null, flags = [];
-
-            if (defaults[k] && typeof defaults[k][0] !== 'undefined') {
-                value = defaults[k][0];
-                if (defaults[k][1]) {
-                    flags = defaults[k][1].split(",");
-                }
-            } else {
-                value = defaults[k];
+    $N.Core = $N.Class.create("Core", {
+        eventContainer: null,
+        eventPrefix: '',
+        cfg: {},
+
+        initialize: function() {
+            this.debug("new instance");
+            $N.registerInstance(this);
+            this.eventContainer = $J('<div/>');
+            this.forwardEvent = this.attach(this._forwardEvent);
+        },
+
+        free: function() {
+            this.eventContainer = null;
+        },
+
+        configure: function(config, defaults) {
+            if (!config){
+                config = {};
+
             }
+            for (k in defaults) {
+                var value = null, flags = [];
 
-            if (typeof config[k] !== 'undefined') 
-                value = config[k];
+                if (defaults[k] && typeof defaults[k][0] !== 'undefined') {
+                    value = defaults[k][0];
+                    if (defaults[k][1]) {
+                        flags = defaults[k][1].split(",");
+                    }
+                } else {
+                    value = defaults[k];
+                }
 
-            var source = this;
-            $J(flags).each(function(i, flag) {
-                switch (flag) {
-                    case 'required':
-                        if (value === null)
-                            throw new $N.RequiredOptionError(source, k);
-                        break;
-                        /*
+                if (typeof config[k] !== 'undefined'){
+                    value = config[k];
+                }
+
+                var source = this;
+                $J(flags).each(function(i, flag) {
+                    switch (flag) {
+                        case 'required':
+                            if (value === null)
+                                throw new $N.RequiredOptionError(source, k);
+                            break;
+                    /*
                     case 'element':
                         value = $J(value);
                         break;
                         */
 
-                }
-            });
+                    }
+                });
 
-            this.cfg[k] = value;
-        }
-        return this;
-    },
-
-    observe: function(eventName, handler) {
-        this.eventContainer.bind(this.eventPrefix + eventName, handler);
-        return this;
-    },
-
-    fire: function(eventName, data) {
-        if (!data)
-            data = {};
-        this.eventContainer.trigger(this.eventPrefix + eventName, data);
-        return this;
-    },
-
-    _forwardEvent: function(e, data) {
-        if (!data)
-            data = {};
-        this.eventContainer.trigger(e.type, data);
-        return this;
-    },
-
-    _textWidth: function(text, fontSize) {
-        var ratio = 3/5;
-        return text.length * ratio * fontSize;
-    },
-
-    debug: function(message) {
-        if ($N.debugging && typeof console != 'undefined' && console.log) {
-            console.log('TimeSide.' + this.__class__.__name__ + ': ' + message);
-        }
-    },
+                this.cfg[k] = value;
+            }
+            return this;
+        },
 
-    attach: function(method) {
-        return $N.attachFunction(this, method);
-    },
+        observe: function(eventName, handler) {
+            this.eventContainer.bind(this.eventPrefix + eventName, handler);
+            return this;
+        },
 
-    attachWithEvent: function(method) {
-        return $N.attachAsEventListener(this, method);
-    },
+        fire: function(eventName, data) {
+            if (!data){
+                data = {};
 
-    uniqid: function() {
-        d = new Date();
-        return new String(d.getTime() + '' + Math.floor(Math.random() * 1000000)).substr(0, 18);
-    }
-});
+            }
+            this.eventContainer.trigger(this.eventPrefix + eventName, data);
+            return this;
+        },
 
-$N.Class.create("Exception", {
-    _source: null,
-    _message: null,
+        _forwardEvent: function(e, data) {
+            if (!data){
+                data = {};
+
+            }
+            this.eventContainer.trigger(e.type, data);
+            return this;
+        },
 
-    initialize: function(source, message) {
-        this._source = source;
-        this._message = message;
-    },
-    toString: function() {
-        return this.__class__.__name__ + " from TimeSide." + this._source.__class__.__name__
+        _textWidth: function(text, fontSize) {
+            var ratio = 3/5;
+            return text.length * ratio * fontSize;
+        },
+
+        debug: function(message) {
+            if ($N.debugging && typeof console != 'undefined' && console.log) {
+                console.log('TimeSide.' + this.__class__.__name__ + ': ' + message);
+            }
+        },
+
+        attach: function(method) {
+            return $N.attachFunction(this, method);
+        },
+
+        attachWithEvent: function(method) {
+            return $N.attachAsEventListener(this, method);
+        },
+
+        uniqid: function() {
+            d = new Date();
+            return new String(d.getTime() + '' + Math.floor(Math.random() * 1000000)).substr(0, 18);
+        }
+    });
+
+    $N.Class.create("Exception", {
+        _source: null,
+        _message: null,
+
+        initialize: function(source, message) {
+            this._source = source;
+            this._message = message;
+        },
+        toString: function() {
+            return this.__class__.__name__ + " from TimeSide." + this._source.__class__.__name__
             + ": " + this._message;
-    }
-});
+        }
+    });
 
-$N.Class.create("RequiredOptionError", $N.Exception, {
-    initialize: function($super, source, optionName) {
-        $super(source, "missing '" + optionName + "' required option");
-    }
-});
+    $N.Class.create("RequiredOptionError", $N.Exception, {
+        initialize: function($super, source, optionName) {
+            $super(source, "missing '" + optionName + "' required option");
+        }
+    });
 
-$N.Class.create("RequiredArgumentError", $N.Exception, {
-    initialize: function($super, source, optionName) {
-        $super(source, "missing '" + optionName + "' required argument");
-    }
-});
+    $N.Class.create("RequiredArgumentError", $N.Exception, {
+        initialize: function($super, source, optionName) {
+            $super(source, "missing '" + optionName + "' required argument");
+        }
+    });
 
-$N.notifyScriptLoad();
+    $N.notifyScriptLoad();
 
 });
index 29ade71f94437cacaf690b2717d17c9615c7fc84..8a285c76e80cc91bc9677e098a5801af5b8be172 100644 (file)
 
 TimeSide(function($N, $J) {
 
-$N.Class.create("MarkerMap", $N.Core, {
-    markers: null,
-
-    initialize: function($super, markers) {
-        $super();
-        if (!markers)
-            markers = [];
-        this.markers = markers;
-    },
-
-    toArray: function() {
-        return [].concat(this.markers);
-    },
-
-    byIndex: function(index) {
-        return this.markers[index];
-    },
-
-    byId: function(id) {
-        var marker = null;
-        for (var i in this.markers) {
-            if (this.markers[i].id == id) {
-                marker = this.markers[i];
-                break;
+    $N.Class.create("MarkerMap", $N.Core, {
+        markers: null,
+
+        initialize: function($super, markers) {
+            $super();
+            if (!markers){
+                markers = [];
             }
-        }
-        return marker;
-    },
-
-    indexOf: function(marker) {
-        var index = null;
-        for (var i in this.markers) {
-            if (this.markers[i].id == marker.id) {
-                index = parseInt(i);
-                break;
+            this.markers = markers;
+        },
+
+        toArray: function() {
+            return [].concat(this.markers);
+        },
+
+        byIndex: function(index) {
+            return this.markers[index];
+        },
+
+        byId: function(id) {
+            var marker = null;
+            for (var i in this.markers) {
+                if (this.markers[i].id == id) {
+                    marker = this.markers[i];
+                    break;
+                }
             }
-        }
-        return index;
-    },
-
-    _reorder: function() {
-        this.markers.sort(this.compare);
-        for (var i in this.markers) {
-            this.fire('indexchange', {marker: this.markers[i], index: parseInt(i)});
-        }
-    },
-
-    add: function(offset, desc) {
-        var id = this.uniqid();
-        var marker = {id: id, offset: offset, desc: desc};
-        var i = this.markers.push(marker) - 1;
-        this.fire('add', {marker: marker, index: i});
-        this._reorder();
-        return marker;
-    },
-
-    remove: function(marker) {
-        if (marker) {
-            var i = this.indexOf(marker);
-            this.markers.splice(i, 1);
-            this.fire('remove', {marker: marker});
+            return marker;
+        },
+
+        indexOf: function(marker) {
+            var index = null;
+            for (var i in this.markers) {
+                if (this.markers[i].id == marker.id) {
+                    index = parseInt(i);
+                    break;
+                }
+            }
+            return index;
+        },
+
+        _reorder: function() {
+            this.markers.sort(this.compare);
+            for (var i in this.markers) {
+                this.fire('indexchange', {
+                    marker: this.markers[i],
+                    index: parseInt(i)
+                    });
+            }
+        },
+
+        add: function(offset, desc) {
+            var id = this.uniqid();
+            var marker = {
+                id: id,
+                offset: offset,
+                desc: desc
+            };
+            var i = this.markers.push(marker) - 1;
+            this.fire('add', {
+                marker: marker,
+                index: i
+            });
             this._reorder();
-        }
-        return marker;
-    },
-
-    compare: function(marker1, marker2) {
-        if (marker1.offset > marker2.offset)
-            return 1;
-        if (marker1.offset < marker2.offset)
-            return -1;
-        return 0;
-    },
-
-    move: function(marker, offset) {
-        oldMarkers = [].concat(this.markers);
-        marker.offset = offset;
-        this._reorder();
-    },
-
-    getPrevious: function(offset, skip) {
-        var marker = null;
-        if (!skip) skip = 0;
-        markers = [].concat(this.markers).reverse();
-        $J(markers).each(function(i, m) {
-            if (offset > m.offset && !(skip--)) {
-                marker = m;
-                return false;
+            return marker;
+        },
+
+        remove: function(marker) {
+            if (marker) {
+                var i = this.indexOf(marker);
+                this.markers.splice(i, 1);
+                this.fire('remove', {
+                    marker: marker
+                });
+                this._reorder();
+            }
+            return marker;
+        },
+
+        compare: function(marker1, marker2) {
+            if (marker1.offset > marker2.offset){
+                return 1;
             }
-        });
-        return marker;
-    },
-
-    getNext: function(offset, skip) {
-        var marker = null;
-        if (!skip) skip = 0;
-        $J(this.markers).each(function(i, m) {
-            if (offset < m.offset && !(skip--)) {
-                marker = m;
-                return false;
+            if (marker1.offset < marker2.offset){
+                return -1;
             }
-        });
-        return marker;
-    },
+            return 0;
+        },
 
-    each: function(callback) {
-        $J(this.markers).each(callback);
-    },
+        move: function(marker, offset) {
+            oldMarkers = [].concat(this.markers);
+            marker.offset = offset;
+            this._reorder();
+        },
 
-    _toString: function() {
-        var s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<telemeta>\n<markers>";
-        for (var i in this.markers) {
+        getPrevious: function(offset, skip) {
+            var marker = null;
+            if (!skip) {
+                skip = 0;
+            }
+            markers = [].concat(this.markers).reverse();
+            $J(markers).each(function(i, m) {
+                if (offset > m.offset && !(skip--)) {
+                    marker = m;
+                    return false;
+                }
+            });
+            return marker;
+        },
+
+        getNext: function(offset, skip) {
+            var marker = null;
+            if (!skip) {
+                skip = 0;
+            }
+            $J(this.markers).each(function(i, m) {
+                if (offset < m.offset && !(skip--)) {
+                    marker = m;
+                    return false;
+                }
+            });
+            return marker;
+        },
+
+        each: function(callback) {
+            $J(this.markers).each(callback);
+        },
+
+        _toString: function() {
+            var s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<telemeta>\n<markers>";
+            for (var i in this.markers) {
                 marker = this.markers[i];
-            s+="\n\t"; //+marker._toString();
-            s+="<marker id="+marker.id+" position="+marker.offset+" description=\""+
-            +marker.desc+"\"/>"
+                s+="\n\t"; //+marker._toString();
+                s+="<marker id="+marker.id+" position="+marker.offset+" description=\""+
+                +marker.desc+"\"/>"
+            }
+            s+="\n</markers>\n</telemeta>";
+            return s;
         }
-        s+="\n</markers>\n</telemeta>";
-        return s;
-    }
 
-});
+    });
 
-$N.notifyScriptLoad();
+    $N.notifyScriptLoad();
 
 });
index 7d368bafa2a789c357c9cf29607590e35ebb9efc..65c9f9cec6f59b70bf3b4d2c22ad19019f8abc1c 100644 (file)
 <link rel="stylesheet"type="text/css" href="{% url telemeta-css "telemeta_ie6.css" %}" />
 <![endif]-->
 {% endblock %}
+<!--<script type="application/x-javascript" src="{% url jsonrpc_browser %}?f=mochikit.js"></script>
+<script type="application/x-javascript" src="{% url jsonrpc_browser %}?f=interpreter.js"></script>-->
 <script src="{% url telemeta-js "jquery.js" %}" type="text/javascript"></script>
 <script src="{% url telemeta-js "application.js" %}" type="text/javascript"></script>
+<!--<script src="{% url telemeta-js "json.js" %}" type="text/javascript"></script>-->
+
 {% block extra_javascript %}{% endblock %}
 </head>
 <body>
index 2407adac8a1ea7d1afb3956f2c6b5d4918702f9d..bcac36f78a17e1ce6f34667cba75d863885cba85 100644 (file)
@@ -116,7 +116,7 @@ class WebView(object):
     def item_detail(self, request, public_id, template='telemeta/mediaitem_detail.html'):
         """Show the details of a given item"""
         item = MediaItem.objects.get(public_id=public_id)
-        
+        print 'ok'
         formats = []
         for encoder in self.encoders:
             formats.append({'name': encoder.format(), 'extension': encoder.file_extension()})
@@ -530,6 +530,10 @@ class WebView(object):
     def logout(self, request):
         auth.logout(request)
         return redirect('telemeta-home')
+
+    @jsonrpc_method('telemeta.add_marker_test')
+    def add_marker_test(request,marker):
+        print "Received"
         
     @jsonrpc_method('telemeta.add_marker')
     def add_marker(request, marker):