<commit_before>/*
 * Copyright (c) 2015
 *
 * This file is licensed under the Affero General Public License version 3
 * or later.
 *
 * See the COPYING-README file.
 *
 */

(function() {
	var TEMPLATE =
		'<div class="thumbnail"></div><div title="{{name}}" class="fileName ellipsis">{{name}}</div>' +
		'<div class="file-details ellipsis">' +
		'    <a href="#" ' +
		'    alt="{{starAltText}}"' +
		'    class="action action-favorite favorite">' +
		'    <img class="svg" src="{{starIcon}}" />' +
		'    </a>' +
		'    <span class="size" title="{{altSize}}">{{size}}</span>, <span class="date" title="{{altDate}}">{{date}}</span>' +
		'</div>';

	/**
	 * @class OCA.Files.MainFileInfoDetailView
	 * @classdesc
	 *
	 * Displays main details about a file
	 *
	 */
	var MainFileInfoDetailView = function() {
		this.initialize();
	};
	/**
	 * @memberof OCA.Files
	 */
	MainFileInfoDetailView.prototype = _.extend({}, OCA.Files.DetailFileInfoView.prototype,
		/** @lends OCA.Files.MainFileInfoDetailView.prototype */ {
		_template: null,

		/**
		 * Initialize the details view
		 */
		initialize: function() {
			this.$el = $('<div class="mainFileInfoView"></div>');
		},

		/**
		 * Renders this details view
		 */
		render: function() {
			this.$el.empty();

			if (!this._template) {
				this._template = Handlebars.compile(TEMPLATE);
			}

			if (this._fileInfo) {
				var isFavorite = (this._fileInfo.tags || []).indexOf(OC.TAG_FAVORITE) >= 0;
				this.$el.append(this._template({
					nameLabel: t('files', 'Name'),
					name: this._fileInfo.name,
					pathLabel: t('files', 'Path'),
					path: this._fileInfo.path,
					sizeLabel: t('files', 'Size'),
					size: OC.Util.humanFileSize(this._fileInfo.size, true),
					altSize: n('files', '%n byte', '%n bytes', this._fileInfo.size),
					dateLabel: t('files', 'Modified'),
					altDate: OC.Util.formatDate(this._fileInfo.mtime),
					date: OC.Util.relativeModifiedDate(this._fileInfo.mtime),
					starAltText: isFavorite ? t('files', 'Favorited') : t('files', 'Favorite'),
					starIcon: OC.imagePath('core', isFavorite ? 'actions/starred' : 'actions/star')
				}));

				// TODO: we really need OC.Previews
				var $iconDiv = this.$el.find('.thumbnail');
				if (this._fileInfo.mimetype !== 'httpd/unix-directory') {
					// TODO: inject utility class?
					FileList.lazyLoadPreview({
						path: this._fileInfo.path + '/' + this._fileInfo.name,
						mime: this._fileInfo.mimetype,
						etag: this._fileInfo.etag,
						x: 50,
						y: 50,
						callback: function(previewUrl) {
							$iconDiv.css('background-image', 'url("' + previewUrl + '")');
						}
					});
				} else {
					// TODO: special icons / shared / external
					$iconDiv.css('background-image', 'url("' + OC.MimeType.getIconUrl('dir') + '")');
				}
				this.$el.find('[title]').tipsy();
			}
		}
	});

	OCA.Files.MainFileInfoDetailView = MainFileInfoDetailView;
})();
<commit_msg>fix tipsy gravity after rebase<commit_after>/*
 * Copyright (c) 2015
 *
 * This file is licensed under the Affero General Public License version 3
 * or later.
 *
 * See the COPYING-README file.
 *
 */

(function() {
	var TEMPLATE =
		'<div class="thumbnail"></div><div title="{{name}}" class="fileName ellipsis">{{name}}</div>' +
		'<div class="file-details ellipsis">' +
		'    <a href="#" ' +
		'    alt="{{starAltText}}"' +
		'    class="action action-favorite favorite">' +
		'    <img class="svg" src="{{starIcon}}" />' +
		'    </a>' +
		'    <span class="size" title="{{altSize}}">{{size}}</span>, <span class="date" title="{{altDate}}">{{date}}</span>' +
		'</div>';

	/**
	 * @class OCA.Files.MainFileInfoDetailView
	 * @classdesc
	 *
	 * Displays main details about a file
	 *
	 */
	var MainFileInfoDetailView = function() {
		this.initialize();
	};
	/**
	 * @memberof OCA.Files
	 */
	MainFileInfoDetailView.prototype = _.extend({}, OCA.Files.DetailFileInfoView.prototype,
		/** @lends OCA.Files.MainFileInfoDetailView.prototype */ {
		_template: null,

		/**
		 * Initialize the details view
		 */
		initialize: function() {
			this.$el = $('<div class="mainFileInfoView"></div>');
		},

		/**
		 * Renders this details view
		 */
		render: function() {
			this.$el.empty();

			if (!this._template) {
				this._template = Handlebars.compile(TEMPLATE);
			}

			if (this._fileInfo) {
				var isFavorite = (this._fileInfo.tags || []).indexOf(OC.TAG_FAVORITE) >= 0;
				this.$el.append(this._template({
					nameLabel: t('files', 'Name'),
					name: this._fileInfo.name,
					pathLabel: t('files', 'Path'),
					path: this._fileInfo.path,
					sizeLabel: t('files', 'Size'),
					size: OC.Util.humanFileSize(this._fileInfo.size, true),
					altSize: n('files', '%n byte', '%n bytes', this._fileInfo.size),
					dateLabel: t('files', 'Modified'),
					altDate: OC.Util.formatDate(this._fileInfo.mtime),
					date: OC.Util.relativeModifiedDate(this._fileInfo.mtime),
					starAltText: isFavorite ? t('files', 'Favorited') : t('files', 'Favorite'),
					starIcon: OC.imagePath('core', isFavorite ? 'actions/starred' : 'actions/star')
				}));

				// TODO: we really need OC.Previews
				var $iconDiv = this.$el.find('.thumbnail');
				if (this._fileInfo.mimetype !== 'httpd/unix-directory') {
					// TODO: inject utility class?
					FileList.lazyLoadPreview({
						path: this._fileInfo.path + '/' + this._fileInfo.name,
						mime: this._fileInfo.mimetype,
						etag: this._fileInfo.etag,
						x: 50,
						y: 50,
						callback: function(previewUrl) {
							$iconDiv.css('background-image', 'url("' + previewUrl + '")');
						}
					});
				} else {
					// TODO: special icons / shared / external
					$iconDiv.css('background-image', 'url("' + OC.MimeType.getIconUrl('dir') + '")');
				}
				this.$el.find('[title]').tipsy({gravity: 'n'});
			}
		}
	});

	OCA.Files.MainFileInfoDetailView = MainFileInfoDetailView;
})();

{'fraction_non_alphanumeric': 0.19411664101248505, 'fraction_numerical': 0.0034205575508807935, 'mean_word_length': 3.25, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7472677', 'n_tokens_mistral': 2406, 'n_tokens_neox': 1974, 'n_words': 375}