2014-04-18 06:06:39 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 The Camlistore Authors
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
goog.provide('cam.DirectoryDetail');
|
|
|
|
|
|
|
|
goog.require('cam.CacheBusterIframe');
|
|
|
|
|
2014-08-15 06:04:37 +00:00
|
|
|
// TODO(aa): Rename file.
|
|
|
|
cam.DirectoryDetail.getAspect = function(baseURL, onChildFrameClick, blobref, targetSearchSession) {
|
2014-08-10 03:17:10 +00:00
|
|
|
if (!targetSearchSession) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var rm = targetSearchSession.getResolvedMeta(blobref);
|
2014-08-15 06:04:37 +00:00
|
|
|
if (!rm || rm.camliType != 'directory') {
|
2014-04-18 06:06:39 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-08-15 06:04:37 +00:00
|
|
|
return {
|
|
|
|
fragment: 'directory',
|
|
|
|
title: 'Directory',
|
|
|
|
createContent: function(size) {
|
|
|
|
var url = baseURL.clone();
|
2014-08-16 04:37:43 +00:00
|
|
|
url.setParameterValue('d', rm.blobRef);
|
2014-08-15 06:04:37 +00:00
|
|
|
return cam.CacheBusterIframe({
|
2014-08-17 02:13:36 +00:00
|
|
|
baseURL: baseURL,
|
2014-08-15 06:04:37 +00:00
|
|
|
height: size.height,
|
|
|
|
onChildFrameClick: onChildFrameClick,
|
|
|
|
src: url,
|
|
|
|
width: size.width,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
2014-04-18 06:06:39 +00:00
|
|
|
};
|