<commit_before>/**
 * ui module
 * 
 * dependencies:
 *  config - site wide JS configuration file
 *  obs
 *  webix - webix UI
 */

define("ui", ["config", "obs", "zoomer", "aperio", "jquery", "webix"], function(config, obs, zoomer, aperio, $){

    /**
     * build()
     *
     * Create Webix UI components and create the final layout
     * which is binded into the main_layout div in index.html 
     * 
     * @param  {OpenSeaDragon} zoomer
     * @return {} None
     */
    
    var slide = null;
    var currentSlideSet = null;
    var viewer = zoomer.viewer;
    var currentItemId = null;

    function build(){    
        //Thumbnail panel that contains list of thumbnails for a slide group
        thumbnailsPanel = {
            view: "dataview",
            id: "thumbnails_panel",
            select: true,
            pager: "thumbPager",
            datafetch: 10,
            loadahead: 10,
            template: "<div class='webix_strong'>#fileName#</div><img src='"+ config.BASE_URL +"/thumbnail/#id#'/>",
            datatype: "json",
            type: { height: 170, width: 200},
            on: {
                "onItemClick": function(id, e, node) {
                    currentItemId = id;
                    slide = this.getItem(id);
                    $$("macro_image").refresh();
                    $$("label_image").refresh();
                    initSlide();
                }
            }

        };

        //dropdown for slide groups
        //Data is pulled from DAS webservice
        dropdown = { 
            view:"combo",  
            placeholder:"Select Slide Set",
            id: "slideset_list",
            options: config.SLIDE_SETS,
            on:{
                "onChange": function(){
                    currentSlideSet = this.getText();
                    $$("thumbnail_search").setValue("");
                    $$("thumbnails_panel").clearAll();
                    $$("thumbnails_panel").load(config.BASE_URL +"/slideset/" + currentSlideSet);
                    $$("thumbnails_panel").setPage(0);
                },
                "onAfterRender": function(){
                    if(config.SLIDE_SETS instanceof Array){
                        currentSlideSet = config.SLIDE_SETS[0].id;
                        $$("thumbnails_panel").clearAll();
                        $$("thumbnails_panel").load(config.BASE_URL +"/slideset/" + currentSlideSet);
                    }
                }
            }<commit_msg>Override slideset list in app configuration file<commit_after>/**
 * ui module
 * 
 * dependencies:
 *  config - site wide JS configuration file
 *  obs
 *  webix - webix UI
 */

define("ui", ["config", "obs", "zoomer", "aperio", "jquery", "webix"], function(config, obs, zoomer, aperio, $){

    /**
     * build()
     *
     * Create Webix UI components and create the final layout
     * which is binded into the main_layout div in index.html 
     * 
     * @param  {OpenSeaDragon} zoomer
     * @return {} None
     */
    
    var slide = null;
    var currentSlideSet = null;
    var viewer = zoomer.viewer;
    var currentItemId = null;

    function build(){    
        //Thumbnail panel that contains list of thumbnails for a slide group
        thumbnailsPanel = {
            view: "dataview",
            id: "thumbnails_panel",
            select: true,
            pager: "thumbPager",
            datafetch: 10,
            loadahead: 10,
            template: "<div class='webix_strong'>#fileName#</div><img src='"+ config.BASE_URL +"/thumbnail/#id#'/>",
            datatype: "json",
            type: { height: 170, width: 200},
            on: {
                "onItemClick": function(id, e, node) {
                    currentItemId = id;
                    slide = this.getItem(id);
                    $$("macro_image").refresh();
                    $$("label_image").refresh();
                    initSlide();
                }
            }
        };

        //dropdown for slide groups
        //Data is pulled from DAS webservice
        dropdown = { 
            view:"combo",  
            placeholder:"Select Slide Set",
            id: "slideset_list",
            options: config.SLIDE_SETS,
            value: "",
            on:{
                "onChange": function(){
                    currentSlideSet = this.getText();
                    $$("thumbnail_search").setValue("");
                    $$("thumbnails_panel").clearAll();
                    $$("thumbnails_panel").load(config.BASE_URL +"/slideset/" + currentSlideSet);
                    $$("thumbnails_panel").setPage(0);
                },
                "onAfterRender": function(data){
                    if(config.SLIDE_SETS instanceof Array){
                        currentSlideSet = config.SLIDE_SETS[0].id;
                        $$("slideset_list").define("value", currentSlideSet);
                        $$("thumbnails_panel").clearAll();
                        $$("thumbnails_panel").load(config.BASE_URL +"/slideset/" + currentSlideSet);
                    }
                }
            }
{'fraction_non_alphanumeric': 0.12850696488130273, 'fraction_numerical': 0.004708652148322542, 'mean_word_length': 1.5150468672915638, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 9, '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': '573351', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1354, 'n_words': 315}