<commit_before>/*globals angular, NProgress*/
/*jshint browser: true*/

(function () {
    'use strict';

    /* Controllers */

    var claytoControllers = angular.module('clayto.controllers', []);

    // Photo URL building rules and size characters acquired at:
    // http://www.flickr.com/services/api/misc.urls.html
    function flickr_get_image_url (photo, size) {
        return ['http://farm',
            photo.farm,
            '.staticflickr.com/',
            photo.server,
            '/',
            photo.id,
            '_',
            photo.secret,
            flickr_get_image_url.SIZES[size],
            '.jpg'].join('');
    }

    flickr_get_image_url.SIZES = {
         75: '_s',
        150: '_q',
        100: '_t',
        240: '_m',
        320: '_n',
        500: '',
        640: '_z',
        800: '_c',
        940: '_b'
    };

    function pre_cache(image) {
        image.img = image.lazy_img;
    }

    function pre_cache_adjacent(scope, count) {
        var i, current;
        for (i = -count; i <= count; i += 1) {
            current = scope.current_photo + i;
            if (current >= 0 && current < scope.photos.length) {
                pre_cache(scope.photos[scope.current_photo + i]);
            }
        }
    }

    claytoControllers.controller(
        'PhotoGalleryCtrl',
        function ($scope, $timeout, $interval, Photoset) {
            // Get the list of photos in clayto.com photoset

            $scope.photos = [];
            $scope.current_photo = 0;

            Photoset.get({}, function(photoset) {

                var photos, i, redirect_delay, redirect_tick;
<commit_msg>add picker for "original" photo site.<commit_after>/*globals angular, NProgress*/
/*jshint browser: true*/

(function () {
    'use strict';

    /* Controllers */

    var claytoControllers = angular.module('clayto.controllers', []);

    // Photo URL building rules and size characters acquired at:
    // http://www.flickr.com/services/api/misc.urls.html
    function flickr_get_image_url (photo, size) {
        return ['http://farm',
            photo.farm,
            '.staticflickr.com/',
            photo.server,
            '/',
            photo.id,
            '_',
            photo.secret,
            flickr_get_image_url.SIZES[size],
            '.jpg'].join('');
    }

    flickr_get_image_url.SIZES = {
         75        : '_s',
        150        : '_q',
        100        : '_t',
        240        : '_m',
        320        : '_n',
        500        : '',
        640        : '_z',
        800        : '_c',
        940        : '_b',
        'original' : '_o'
    };

    function pre_cache(image) {
        image.img = image.lazy_img;
    }

    function pre_cache_adjacent(scope, count) {
        var i, current;
        for (i = -count; i <= count; i += 1) {
            current = scope.current_photo + i;
            if (current >= 0 && current < scope.photos.length) {
                pre_cache(scope.photos[scope.current_photo + i]);
            }
        }
    }

    claytoControllers.controller(
        'PhotoGalleryCtrl',
        function ($scope, $timeout, $interval, Photoset) {
            // Get the list of photos in clayto.com photoset

            $scope.photos = [];
            $scope.current_photo = 0;

            Photoset.get({}, function(photoset) {

                var photos, i, redirect_delay, redirect_tick;

{'fraction_non_alphanumeric': 0.13507178435394082, 'fraction_numerical': 0.0169938470553765, 'mean_word_length': 1.5824508320726172, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3787609', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1024, 'n_words': 219}