Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
64 | 2 | 2 | 0.981 | SourceElements[10] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 69 | 81 | Closure/closure/goog/ui/media/picasa.js |
2 | 64 | 76 | Closure/closure/goog/ui/media/vimeo.js |
| ||||
goog.require('goog.ui.media.FlashObject'); goog.require('goog.ui.media.Media'); goog.require('goog.ui.media.MediaModel'); goog.require('goog.ui.media.MediaModel.Player'); goog.require('goog.ui.media.MediaRenderer'); /** * Subclasses a goog.ui.media.MediaRenderer to provide a Picasa specific media * renderer. * * This class knows how to parse picasa URLs, and render the DOM structure * of picasa album players and previews. This class is meant to be used as a * singleton static stateless class, that takes {@code goog.ui.media.Media} * instances and renders it. It expects {@code goog.ui.media.Media.getModel} to * return a well formed, previously constructed, object with a user and album * fields {@see goog.ui.media.PicasaAlbum.parseUrl}, which is the data model * this renderer will use to construct the DOM structure. * {@see goog.ui.media.PicasaAlbum.newControl} for a example of constructing a * control with this renderer. * * goog.ui.media.PicasaAlbum currently displays a picasa-made flash slideshow * with the photos, but could possibly display a handwritten js photo viewer, * in case flash is not available. * * This design is patterned after http://go/closure_control_subclassing * * It uses {@link goog.ui.media.FlashObject} to embed the flash object. * * @constructor * @extends {goog.ui.media.MediaRenderer} */ goog.ui.media.PicasaAlbum= function ( ) { goog.ui.media.MediaRenderer.call(this ); } ; goog.inherits(goog.ui.media.PicasaAlbum, goog.ui.media.MediaRenderer); goog.addSingletonGetter(goog.ui.media.PicasaAlbum); /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * * @type {string} */ goog.ui.media.PicasaAlbum.CSS_CLASS= goog.getCssName('goog-ui-media-picasa'); /** * A static convenient method to construct a goog.ui.media.Media control out of * a picasa data model. It sets it as the data model goog.ui.media.PicasaAlbum * renderer uses, sets the states supported by the renderer, and returns a * Control that binds everything together. This is what you should be using for * constructing Picasa albums, except if you need finer control over the * configuration. * * @param {goog.ui.media.PicasaAlbumModel} dataModel A picasa album data model. * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for * document interaction. * @return {goog.ui.media.Media} A Control instance binded to the Picasa * renderer. */ goog.ui.media.PicasaAlbum.newControl= function (dataModel, opt_domHelper){ var control= new goog.ui.media.Media( dataModel, goog.ui.media.PicasaAlbum.getInstance( ), opt_domHelper); control.setSelected( true); return control; } ; |
| ||||
goog.require('goog.ui.media.FlashObject'); goog.require('goog.ui.media.Media'); goog.require('goog.ui.media.MediaModel'); goog.require('goog.ui.media.MediaModel.Player'); goog.require('goog.ui.media.MediaRenderer'); /** * Subclasses a goog.ui.media.MediaRenderer to provide a Vimeo specific media * renderer. * * This class knows how to parse Vimeo URLs, and render the DOM structure * of vimeo video players. This class is meant to be used as a singleton static * stateless class, that takes {@code goog.ui.media.Media} instances and renders * it. It expects {@code goog.ui.media.Media.getModel} to return a well formed, * previously constructed, vimeoId {@see goog.ui.media.Vimeo.parseUrl}, which is * the data model this renderer will use to construct the DOM structure. * {@see goog.ui.media.Vimeo.newControl} for a example of constructing a control * with this renderer. * * This design is patterned after http://go/closure_control_subclassing * * It uses {@link goog.ui.media.FlashObject} to embed the flash object. * * @constructor * @extends {goog.ui.media.MediaRenderer} */ goog.ui.media.Vimeo= function ( ) { goog.ui.media.MediaRenderer.call(this ); } ; goog.inherits(goog.ui.media.Vimeo, goog.ui.media.MediaRenderer); goog.addSingletonGetter(goog.ui.media.Vimeo); /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * * @type {string} */ goog.ui.media.Vimeo.CSS_CLASS= goog.getCssName('goog-ui-media-vimeo'); /** * A static convenient method to construct a goog.ui.media.Media control out of * a Vimeo URL. It extracts the videoId information on the URL, sets it * as the data model goog.ui.media.Vimeo renderer uses, sets the states * supported by the renderer, and returns a Control that binds everything * together. This is what you should be using for constructing Vimeo videos, * except if you need more fine control over the configuration. * * @param {goog.ui.media.VimeoModel} dataModel A vimeo video URL. * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for * document interaction. * @return {goog.ui.media.Media} A Control binded to the Vimeo renderer. */ goog.ui.media.Vimeo.newControl= function (dataModel, opt_domHelper){ var control= new goog.ui.media.Media( dataModel, goog.ui.media.Vimeo.getInstance( ),opt_domHelper); // vimeo videos don't have any thumbnail for now, so we show the // "selected" version of the UI at the start, which is the // flash player. control.setSelected( true); return control; } ; |
| |||
goog.require('goog.ui.media.FlashObject'); goog.require('goog.ui.media.Media'); goog.require('goog.ui.media.MediaModel'); goog.require('goog.ui.media.MediaModel.Player'); goog.require('goog.ui.media.MediaRenderer'); /** * Subclasses a goog.ui.media.MediaRenderer to provide a Vimeo specific media * renderer. * * This class knows how to parse Vimeo URLs, and render the DOM structure * of vimeo video players. This class is meant to be used as a singleton static * stateless class, that takes {@code goog.ui.media.Media} instances and renders * it. It expects {@code goog.ui.media.Media.getModel} to return a well formed, * previously constructed, vimeoId {@see goog.ui.media.Vimeo.parseUrl}, which is * the data model this renderer will use to construct the DOM structure. * {@see goog.ui.media.Vimeo.newControl} for a example of constructing a control * with this renderer. * * This design is patterned after http://go/closure_control_subclassing * * It uses {@link goog.ui.media.FlashObject} to embed the flash object. * * @constructor * @extends {goog.ui.media.MediaRenderer} */ /** * Subclasses a goog.ui.media.MediaRenderer to provide a Picasa specific media * renderer. * * This class knows how to parse picasa URLs, and render the DOM structure * of picasa album players and previews. This class is meant to be used as a * singleton static stateless class, that takes {@code goog.ui.media.Media} * instances and renders it. It expects {@code goog.ui.media.Media.getModel} to * return a well formed, previously constructed, object with a user and album * fields {@see goog.ui.media.PicasaAlbum.parseUrl}, which is the data model * this renderer will use to construct the DOM structure. * {@see goog.ui.media.PicasaAlbum.newControl} for a example of constructing a * control with this renderer. * * goog.ui.media.PicasaAlbum currently displays a picasa-made flash slideshow * with the photos, but could possibly display a handwritten js photo viewer, * in case flash is not available. * * This design is patterned after http://go/closure_control_subclassing * * It uses {@link goog.ui.media.FlashObject} to embed the flash object. * * @constructor * @extends {goog.ui.media.MediaRenderer} */ goog.ui.media. [[#variable5ce91d00]]= function ( ) { goog.ui.media.MediaRenderer.call(this ); } ; goog.inherits(goog.ui.media. [[#variable5ce91d00]],goog.ui.media.MediaRenderer); goog.addSingletonGetter(goog.ui.media. [[#variable5ce91d00]]); /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * * @type {string} */ goog.ui.media. [[#variable5ce91d00]].CSS_CLASS=goog.getCssName( [[#variable5ce91c00]]); /** * A static convenient method to construct a goog.ui.media.Media control out of * a Vimeo URL. It extracts the videoId information on the URL, sets it * as the data model goog.ui.media.Vimeo renderer uses, sets the states * supported by the renderer, and returns a Control that binds everything * together. This is what you should be using for constructing Vimeo videos, * except if you need more fine control over the configuration. * * @param {goog.ui.media.VimeoModel} dataModel A vimeo video URL. * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for * document interaction. * @return {goog.ui.media.Media} A Control binded to the Vimeo renderer. */ /** * A static convenient method to construct a goog.ui.media.Media control out of * a picasa data model. It sets it as the data model goog.ui.media.PicasaAlbum * renderer uses, sets the states supported by the renderer, and returns a * Control that binds everything together. This is what you should be using for * constructing Picasa albums, except if you need finer control over the * configuration. * * @param {goog.ui.media.PicasaAlbumModel} dataModel A picasa album data model. * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for * document interaction. * @return {goog.ui.media.Media} A Control instance binded to the Picasa * renderer. */ goog.ui.media. [[#variable5ce91d00]].newControl= function (dataModel,opt_domHelper) { var control=new goog.ui.media.Media(dataModel,goog.ui.media. [[#variable5ce91d00]].getInstance( ),opt_domHelper); // vimeo videos don't have any thumbnail for now, so we show the // "selected" version of the UI at the start, which is the // flash player. control.setSelected( true); return control; } ; |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5ce91d00]] | Vimeo |
1 | 2 | [[#5ce91d00]] | PicasaAlbum |
2 | 1 | [[#5ce91c00]] | 'goog-ui-media-vimeo' |
2 | 2 | [[#5ce91c00]] | 'goog-ui-media-picasa' |