Changeset 5274 for DASISH


Ignore:
Timestamp:
05/23/14 13:40:46 (10 years ago)
Author:
olof.olsson@snd.gu.se
Message:

added open remote cache menu action

Location:
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js

    r4888 r5274  
    163163                    // Database insert request is true if successful
    164164                    // Firebug.Console.log(rtn);
     165                    annotationProxy.log('called cache stuff');
    165166                    callback.call(undefined, aid); 
    166                     annotationProxy.log('called cache stuff');
     167                   
    167168                }
    168169            });
     
    227228            var xhr = new XMLHttpRequest();
    228229            xhr.onload = function() {
    229                 annotationProxy.log("Cache POST status: "+xhr.status);
     230                annotationProxy.log("Cache POST status for "+targetURL+": "+xhr.status);
     231                annotationProxy.log(xhr.statusText);
    230232            };
    231233            xhr.open("POST", targetURL, true);
     
    242244                           cache+'\n\n' +
    243245                           '--'+boundary+'--';
     246            annotationProxy.log(postBody);       
    244247            xhr.send(postBody);
    245248        },
     
    264267            });         
    265268        },
     269        getCacheURL: function (targetURL, callback){
     270            $.ajax({
     271                type: "GET",
     272                url: targetURL,
     273                dataType: "xml",
     274                success: function(xml, textStatus, jqXHR) {
     275                    $xml = $.parseXML(jqXHR.responseText);
     276                   
     277                    jQuery($xml).find('cached').each(function() {
     278                        var cacheURL = this.getAttribute('ref');
     279                        callback.call(undefined, cacheURL);
     280                    });
     281                   
     282                                 
     283                }
     284            });               
     285        },
    266286        setBackend: function(url) {
    267287            this.backend = url;
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js

    r4929 r5274  
    118118            });
    119119        },
    120         getCacheURL: function(om_object){
     120        openRemoteCache: function(event){
     121            this.log(event);
     122            var oid = bitsAutocacheService.bitsItemView.object.oid;
     123            var cacheUrl = this.getCacheURL(oid);
     124           
     125           
     126        },
     127        getCacheURL: function(oid, tabbed){
     128            var aid = this.getAidFromOid(oid);
     129            annotationFramework.getTargets(aid, function(targets){
     130                var targetURL = targets[0];
     131                annotationProxy.log('targets');
     132                annotationProxy.log(targets[0]);
     133                annotationFramework.getCacheURL(targetURL, function(cacheURL){
     134                    cacheURL += '/stream';
     135                    annotationProxy.log('cacheURL');
     136                    annotationProxy.log(cacheURL);
     137                   
     138                    bitsAutocacheService.Common.loadURL(cacheURL,tabbed);
     139                });
     140            });
    121141           
    122142        },
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/autocacheSidebarOverlay.xul

    r4927 r5274  
    122122                        id="bitsItemTreePopupCacheOpenRemote"
    123123                        label="&markingcollection.autocache.open.remote;"
    124                         oncommand="alert('TODO remote cache')"/>
     124                        oncommand="window.top.annotationProxy.openRemoteCache(event, false);"/>
    125125                    <menuitem
    126126                        id="bitsItemTreePopupCacheOpenRemoteNewTab"
    127127                        label="&markingcollection.autocache.open.remotenewtab;"
    128                         oncommand="alert('TODO remote cache in new tab')"/>
     128                        oncommand="window.top.annotationProxy.openRemoteCache(event, true);"/>
    129129                    <menuitem
    130130                        id="bitsItemTreePopupCacheOpen"
Note: See TracChangeset for help on using the changeset viewer.