var clubplugin = { config : { class_prefix : 'o-kcp-', url : 'https://www.knkv.nl/kcp/aa67686d85cd96fe340/team/31547,19271,19271/', clean_url : 'https://www.knkv.nl/kcp/aa67686d85cd96fe340/', club_id : 'NCX20G0', t_code : '31547,19271,19271/', type : 'team/', standing : 'full', standing_heading : 'small', tabs : { } }, tabs : [ { i : 1, k: 'pr', t: 'program-tab-title' }, { i : 2, k: 're', t: 'result-tab-title' }, { i : 3, k: 'st', t: 'standing-tab-title' }, { i : 4, k: 'te', t: 'teams-tab-title' } /* , { i : 5, k: 'ma', t: 'matrix-tab-title' }, { i : 6, k: 'ci', t: 'club-info-tab-title' } */ ], data : { obj : null, loader : null, page_loader : null, tabs : null, content : null, size : { width: null, height : null }, current_item : null, teams : {}, cache : { results : {}, results_full : {} } }, load : function(ele){ this.data.obj = jQuery(ele); this._init(); this._init_tabs(); //this._stop_loader(); }, _init : function(){ this.data.page_loader = this.data.obj.find('.'+clubplugin.config.class_prefix+'page_loader'); this.data.size.width = this.data.obj.width(); this.data.size.height = this.data.obj.height(); this.data.obj.append(clubplugin.views.get('page_loader',{})); this.data.obj.append(clubplugin.views.get('body',{})); this.data.tabs = this.data.obj.find('.'+clubplugin.config.class_prefix+'tabs'); this.data.content = this.data.obj.find('.'+clubplugin.config.class_prefix+'content-block'); clubplugin._show_loader(); }, _init_tabs : function(){ var c = 0; jQuery.each(clubplugin.tabs, function(i,item){ if(item.i != undefined && (clubplugin.config.tabs[item.i] == undefined || clubplugin.config.tabs[item.i])){ if(clubplugin.config.t_code == '' || clubplugin.config.t_code != '' && item.t != 'teams-tab-title') { if(clubplugin.config.type != 'team_url/' || (clubplugin.config.type == 'team_url/' && item.t == 'teams-tab-title')){ c == 0 ? clubplugin.data.current_item = item.k : ''; clubplugin._create_tab(item, c++); } } } }); if(c > 0){ // var w = Math.ceil(100 / c); var w = 100 / c; this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item').css({ 'width' : w+'%' }); } this._bind_tabs(); this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item:first').addClass('active').addClass('first').trigger('click'); this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item:last').addClass('last'); }, _bind_tabs : function(){ this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item').unbind('click').click(function(){ clubplugin.data.current_item = jQuery(this).attr('rel'); clubplugin._show_content(); }); }, _create_tab : function(item,i){ this._add_tab(item); //this._add_content(item); }, _add_tab : function(item){ this.data.tabs.append(clubplugin.views.get('tab_item',item)); }, _show_loader : function(){ clubplugin.data.obj.find('.'+clubplugin.config.class_prefix+'page_loader').show(); }, _stop_loader : function(){ clubplugin.data.obj.find('.'+clubplugin.config.class_prefix+'page_loader').hide(); }, _set_active_tab : function(){ this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item').removeClass('active'); this.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item[rel="'+this.data.current_item+'"]').addClass('active'); }, _show_content : function(){ this._set_active_tab(); this._create_content(); }, _create_content : function(){ switch(this.data.current_item){ case 'pr': default: this._program_content(); break; case 're': this._result_content(); break; case 'st': this._standing_content(); break; case 'te': this._teams_content(); break; case 'ma': this._matrix_content(); break; case 'ci': this._ci_content(); break; } }, _program_content : function(){ var content = '', blocks = '', result = false, club = {}, club_id = ''; clubplugin._show_loader(); club.club_id = this.config.club_id; content = clubplugin.views.get('show_knkv_club_link', club); jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_program' }, success: function(results){ jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; club.club_id = matches.c; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; match.time = match.time != null ? match.time : ' - '; match.field = match.field != null ? match.field : ' - '; match.facility = clubplugin.views.get('show_facility_link', {name: match.facility_name, code: match.facility_id}); if(match.htc_id == clubplugin.config.club_id) { match.home_team_name = clubplugin.views.get('show_team_link', {title:match.home_team_name,id:match.home_team_id}) } if(match.atc_id == clubplugin.config.club_id) { match.away_team_name = clubplugin.views.get('show_team_link', {title:match.away_team_name,id:match.away_team_id}) } block.rows += clubplugin.views.get('show_match_program',match); result = true; }); blocks += clubplugin.views.get('show_match_block',block); }); content += clubplugin.views.get('show_program',blocks); if(result == false) { content += clubplugin.views.get('show_no_matches'); } content += clubplugin.views.get('show_knkv_club_link', club); clubplugin.data.content.html(content); clubplugin._bind_program_full(); clubplugin._bind_team_link(); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _program_content_full : function(){ var content = '', blocks = '', result = false, club = {}, club_id = ''; clubplugin._show_loader(); club.club_id = this.config.club_id; content = clubplugin.views.get('show_knkv_club_link_back', club); jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_program', full:'1' }, success: function(results){ jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; club.club_id = matches.c; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; match.time = match.time != null ? match.time : ' - '; match.field = match.field != null ? match.field : ' - '; match.facility = clubplugin.views.get('show_facility_link', {name: match.facility_name, code: match.facility_id}); if(match.htc_id == clubplugin.config.club_id) { match.home_team_name = clubplugin.views.get('show_team_link', {title:match.home_team_name,id:match.home_team_id}) } if(match.atc_id == clubplugin.config.club_id) { match.away_team_name = clubplugin.views.get('show_team_link', {title:match.away_team_name,id:match.away_team_id}) } block.rows += clubplugin.views.get('show_match_program',match); result = true; }); blocks += clubplugin.views.get('show_match_block',block); }); content += clubplugin.views.get('show_program',blocks); if(result == false) { content += clubplugin.views.get('show_no_matches'); } content += clubplugin.views.get('show_knkv_club_link_back', club); clubplugin.data.content.html(content); clubplugin._bind_program_full(); clubplugin._bind_team_link(); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _result_content : function(paging){ clubplugin._show_loader(); var content = 'geen resultaten gevonden', blocks = '', result = false; if(paging == undefined)paging = 0; if(this.data.cache.results[paging] != undefined) { content = this.data.cache.results[paging]; clubplugin.data.content.html(content); clubplugin._bind_result_paging(); clubplugin._bind_results_full(); clubplugin._bind_team_link('results'); clubplugin._stop_loader(); return; } jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', // jsonpCallback : 'jsonp_return', data: { f:'get_results', p:paging }, success: function(results){ content = clubplugin.views.get('show_results_paging', paging); jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; if(match.htc_id == clubplugin.config.club_id) { match.home_team_name = clubplugin.views.get('show_team_link', {title:match.home_team_name,id:match.home_team_id}) } if(match.atc_id == clubplugin.config.club_id) { match.away_team_name = clubplugin.views.get('show_team_link', {title:match.away_team_name,id:match.away_team_id}) } block.rows += clubplugin.views.get('show_match_result',match); result = true; }); if(paging == 0 && result == false) { block.rows += clubplugin.views.get('show_no_results'); result = true; } blocks += clubplugin.views.get('show_match_block',block); }); if(result == true) { content += ''; } content += clubplugin.views.get('show_results',blocks); if(result == false) { content += clubplugin.views.get('show_no_results'); } if(clubplugin.data.cache.results == undefined) { clubplugin.data.cache.results = {}; } clubplugin.data.cache.results[paging] = content; clubplugin.data.content.html(content); clubplugin._bind_result_paging(); clubplugin._bind_results_full(); clubplugin._bind_team_link('results'); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _result_content_full : function(paging){ var content = 'geen resultaten gevonden', blocks = '', result = false; clubplugin._show_loader(); if(paging == undefined)paging = 0; if(this.data.cache.results_full[paging] != undefined) { content = this.data.cache.results_full[paging]; clubplugin.data.content.html(content); clubplugin._bind_result_paging_full(); clubplugin._bind_results_full(); clubplugin._bind_team_link('results'); clubplugin._stop_loader(); return; } jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_results', full:'1', p:paging }, success: function(results){ content = clubplugin.views.get('show_results_paging_full', paging); jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; if(match.htc_id == clubplugin.config.club_id) { match.home_team_name = clubplugin.views.get('show_team_link', {title:match.home_team_name,id:match.home_team_id}) } if(match.atc_id == clubplugin.config.club_id) { match.away_team_name = clubplugin.views.get('show_team_link', {title:match.away_team_name,id:match.away_team_id}) } block.rows += clubplugin.views.get('show_match_result',match); result = true; }); if(paging == 0 && result == false) { block.rows += clubplugin.views.get('show_no_results'); result = true; } blocks += clubplugin.views.get('show_match_block',block); }); if(result == true) { content += ''; } content += clubplugin.views.get('show_results',blocks); if(result == false) { content += clubplugin.views.get('show_no_results'); } if(clubplugin.data.cache.results_full == undefined) { clubplugin.data.cache.results_full = {}; clubplugin._stop_loader(); } clubplugin.data.cache.results_full[paging] = content; clubplugin.data.content.html(content); clubplugin._bind_result_paging_full(); clubplugin._bind_results_full(); clubplugin._bind_team_link('results'); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _standing_content : function(){ clubplugin._show_loader(); var content = '', blocks = ''; jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', //jsonpCallback : 'jsonp_return', data: { f:'get_standings', standing: this.config.standing, heading: this.config.standing_heading }, success: function(results){ jQuery.each(results.poules, function(key, poule){ blocks += clubplugin.views.get('show_standing', poule); }); content = clubplugin.views.get('show_club_standings', blocks); clubplugin.data.content.html(content); clubplugin._bind_standing_filter(); clubplugin._set_standing_filter(results.default_serie); clubplugin._bind_team_link('standing'); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ alert('Error: ' + textStatus +' '+ errorThrown); } }); }, _matrix_content : function(){ var content = '', result = false; jQuery.post(this.config.url, { f:'get_matrixes' }, function(results){ jQuery.each(results, function(key, poule){ content += poule; }) clubplugin.data.content.html(content); }, "json"); }, _show_team : function(team_id, function_name) { jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_team', i: team_id }, success: function(results){ for(var key in results) { jQuery.each(results[key], function(id, team) { clubplugin.data.teams[team.id] = team; clubplugin._team_content(team, function_name); }); } clubplugin.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item').removeClass('active'); clubplugin.data.obj.find('.'+clubplugin.config.class_prefix+'tab-item[rel="te"]').addClass('active'); //Team tab } }); }, _teams_content : function(){ clubplugin._show_loader(); var content = '', teams = ''; jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', // jsonpCallback : 'jsonp_return', data: { f:'get_teams' }, success: function(results){ for(var key in results) { teams += clubplugin.views.get('show_head_line', key); jQuery.each(results[key]['v'], function(id, team) { value_team = team; value_team.id = value_team.team_id_group; if(clubplugin.config.type == 'team_url/') { value_team.url = clubplugin.config.clean_url; teams += clubplugin.views.get('show_team_url_line', value_team); } else { teams += clubplugin.views.get('show_team_line', value_team); } clubplugin.data.teams[value_team.id] = value_team; }); } content += clubplugin.views.get('show_teams', teams); clubplugin.data.content.html(content); clubplugin._bind_teams(); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _log : function(t){ /*var d = new Date(); //console.log(t+' - '+d.getMinutes()+':'+d.getSeconds()+'.'+d.getMilliseconds()); */ }, _ajax : function(url,data){ jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_teams' }, success: function(results){ }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _team_content : function(team_id, function_name, full, paging) { if(this.data.teams[team_id] == undefined){ if(this.data.teams[team_id.id] == undefined){ alert('Ongeldig team!'); team = {}; } else { team = this.data.teams[team_id.id]; team_id = team_id.id; } } else { var team = this.data.teams[team_id]; } full = full == 1 ? 1 : 0; //Start blank team.program = ''; team.results = ''; team.standing = ''; if(function_name == undefined) { function_name = 'program'; } team[function_name] = 'active'; var content = this.views.get('show_team_menu', team); var cache_var = new String('p'+paging+'p'); if(paging != undefined && this.data.cache[team.id][function_name][cache_var] != undefined && function_name != undefined && this.data.cache[team.id] != undefined && this.data.cache[team.id][function_name] != undefined){ content = this.data.cache[team.id][function_name][cache_var]; clubplugin.data.content.html(content); } else if(function_name != undefined && this.data.cache[team.id] != undefined && this.data.cache[team.id][function_name] != undefined && paging == undefined && this.data.cache[team.id][function_name][cache_var] != undefined){ content = this.data.cache[team.id][function_name][full]; clubplugin.data.content.html(content); } else if(function_name != '' && typeof clubplugin['_team_'+function_name+'_content'] == 'function'){ this['_team_'+function_name+'_content'].apply(this, [team, content, function_name, full, paging]); } else { content += clubplugin.views.get('show_knkv_club_link', team, full); clubplugin.data.content.html(content); } clubplugin._bind_team_tabs(team); clubplugin._bind_team_result_paging(team); }, _team_program_content : function(team, content, function_name, full){ clubplugin._show_loader(); var blocks = '', result = false; jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_program', full: full, team_id: team.id }, success: function(results){ jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; match.time = match.time != null ? match.time : ' - '; match.field = match.field != null ? match.field : ' - '; match.facility = clubplugin.views.get('show_facility_link', {name: match.facility_name, code: match.facility_id}); block.rows += clubplugin.views.get('show_match_program',match); result = true; }); blocks += clubplugin.views.get('show_match_block',block); }); content += clubplugin.views.get('show_program',blocks); if(result == false) { content += clubplugin.views.get('show_no_results'); } if(clubplugin.data.cache[team.id] == undefined) clubplugin.data.cache[team.id] = {}; if(clubplugin.data.cache[team.id][function_name] == undefined) clubplugin.data.cache[team.id][function_name] = {}; clubplugin.data.cache[team.id][function_name][full] = content; var club = { club_id:team.club_id }; if(full != 1) { content += clubplugin.views.get('show_knkv_club_link', 'team'); } else { content += clubplugin.views.get('show_knkv_club_link_back', 'team'); } clubplugin.data.content.html(content); clubplugin._bind_team_tabs(team); clubplugin._bind_program_full('team', team); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _team_results_content : function(team, content, function_name, full, paging){ clubplugin._show_loader(); var blocks = '', result = false; if(paging == undefined)paging=0; jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_results', team_id: team.id, p:paging }, success: function(results){ content += clubplugin.views.get('show_results_paging_team', paging); jQuery.each(results, function(date, matches) { block = { date: date, rows: '', week_start : matches.week_start, week_end : matches.week_end, week_number : matches.week_number }; jQuery.each(matches.items, function(i, match){ match.cls = 'team'; block.rows += clubplugin.views.get('show_match_result',match); result = true; }); blocks += clubplugin.views.get('show_match_block',block); }); content += clubplugin.views.get('show_results',blocks); if(result == false) { content += clubplugin.views.get('show_no_results'); } if(clubplugin.data.cache[team.id] == undefined) clubplugin.data.cache[team.id] = {}; if(clubplugin.data.cache[team.id][function_name] == undefined) clubplugin.data.cache[team.id][function_name] = {}; var cache_var = JSON.stringify('p'+paging+'p'); clubplugin.data.cache[team.id][function_name][cache_var] = content; clubplugin.data.content.html(content); clubplugin._bind_team_tabs(team); clubplugin._bind_team_result_paging(team); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _team_standing_content : function(team, content, function_name, full){ clubplugin._show_loader(); var result = false, blocks = '', block = {}, lastline, view = this.config.standing_heading != 'full' ? 'show_standing_block_small' : 'show_standing_block'; jQuery.ajax({ url: this.config.url, type: 'POST', dataType: "jsonp", jsonp: 'callback', jsonpCallback : 'jsonp_return', data: { f:'get_team_standings', team_id: team.id }, success: function(results){ jQuery.each(results, function(i, poule) { block = { poule_name: poule.poule.poule_name, rows: '' }; jQuery.each(poule.lines, function(i, line){ if (line != undefined) { line.difference = parseInt(line.goals_for) - parseInt(line.goals_against); line.cls = clubplugin.config.club_id == line.club_id ? 'team-line' : ''; block.rows += clubplugin.views.get('show_standing_line',line); result = true; lastline = line; } }); block.poule_name += ' | ' + gt(lastline.sport) + ' ' + gt(lastline.serie); blocks += clubplugin.views.get(view, block); }); if(clubplugin.data.cache[team.id] == undefined) clubplugin.data.cache[team.id] = {}; if(clubplugin.data.cache[team.id][function_name] == undefined) clubplugin.data.cache[team.id][function_name] = {}; content += clubplugin.views.get('show_standings', blocks); clubplugin.data.cache[team.id][function_name][full] = content; clubplugin.data.content.html(content); clubplugin._bind_team_tabs(team); clubplugin._stop_loader(); }, error: function(jqXHR,textStatus,errorThrown){ } }); }, _ci_content : function(){ this.data.content.html( 'Club informatie'); }, _set_standing_filter : function(v) { jQuery('.o-switch-sport option[value='+v+']').attr('selected', 'selected'); jQuery('.o-switch-sport').trigger('change'); }, _bind_standing_filter : function() { jQuery('.o-switch-sport').unbind().bind('change', function(){ var v = jQuery(this).val(); if(v == '') { jQuery('.o-standing-block').show(); } else { jQuery('.o-standing-block:not(.'+v+')').hide(); jQuery('.o-standing-block.'+v).show(); } }); }, _bind_teams : function(){ var team_id; jQuery('.show_team').unbind().bind('click', function(){ clubplugin._log(0.1); team_id = jQuery(this).attr('rel'); clubplugin._team_content(team_id); }); }, _bind_team_tabs : function(team){ jQuery('.show_team_program').unbind().bind('click', function() { clubplugin._team_content(team, 'program', 0); }); jQuery('.show_team_results').unbind().bind('click', function() { clubplugin._team_content(team, 'results'); }); jQuery('.show_team_standing').unbind().bind('click', function() { clubplugin._team_content(team, 'standing'); }); }, _bind_result_paging : function() { jQuery(".paging-link:not('.disabled')").unbind().bind('click', function(){ clubplugin._result_content(jQuery(this).attr('rel')); }); }, _bind_result_paging_full : function() { jQuery(".paging-link:not('.disabled')").unbind().bind('click', function(){ clubplugin._result_content_full(jQuery(this).attr('rel')); }); }, _bind_team_result_paging : function(team) { jQuery(".paging-link:not('.disabled')").unbind().bind('click', function(){ clubplugin._team_content(team, 'results', 0, jQuery(this).attr('rel')); }); }, _bind_program_full : function(type, team) { jQuery('.'+this.config.class_prefix+'knkv-link').unbind().bind('click', function() { if(type == 'team') { clubplugin._team_content(team, 'program', 1); } else { clubplugin._program_content_full(); } }); jQuery('.'+this.config.class_prefix+'knkv-link-back').unbind().bind('click', function() { if(type == 'team') { clubplugin._team_content(team, 'program', 0); } else { clubplugin._program_content(); } }); return false; }, _bind_results_full : function() { jQuery('.full-poule-results').unbind().bind('click', function() { clubplugin._result_content_full(jQuery(this).attr('rel')); return false; }); jQuery('.club-results').unbind().bind('click', function() { clubplugin._result_content(jQuery(this).attr('rel')); return false; }); }, _bind_team_link : function(function_name) { jQuery('.'+clubplugin.config.class_prefix+'team-link').unbind().bind('click', function() { clubplugin._show_team(jQuery(this).attr('rel'), function_name); }); } }; clubplugin.translation = { 'laden' : 'Laden...', 'bezig-met-laden' : 'bezig met laden...', 'program-tab-title' : 'Programma', 'result-tab-title' : 'Uitslagen', 'standing-tab-title' : 'Standen', 'matrix-tab-title' : 'Matrix', 'club-info-tab-title' : 'Club Informatie', 'teams-tab-title' : 'Teams', 'Programma' : 'Programma', 'Uitslagen' : 'Uitslagen', 'Standen' : 'Standen', 'KORFBALL-VE-WK' : 'Veld', 'KORFBALL-ZA-WK' : 'Zaal', 'geen_wedstrijden' : 'Er zijn geen wedstrijden gepland voor deze week.', 'geen_uitslagen' : 'Er staan deze week geen wedstrijden gepland.', 'stand_#' : '#', 'stand_team' : 'Team', 'stand_played' : 'Gespeeld', 'stand_points' : 'Punten', 'stand_won' : 'Winst', 'stand_draw' : 'Gelijk', 'stand_lost' : 'Verlies', 'stand_goals_for' : 'Doelpunten voor', 'stand_goals_against' : 'Doelpunten tegen', 'stand_difference' : 'Verschil', 'stand_penalties' : 'Strafpunten' }; function gt(name){ if(clubplugin.translation[name] != undefined){ return clubplugin.translation[name]; } else { //console.log('Translation: '+ name); return name; } } clubplugin.views = { get : function(tn, data){ if(this.views[tn] == undefined){ throw('Could not find plugin template.'); } else { return this.views[tn](data, clubplugin.config); } }, views : { } }; function jsonp_return(result){ return result; //alert('appels_called'); } clubplugin.views.views = { page_loader : function(d,c){ return '
'+gt('bezig-met-laden')+'
'; }, body : function(d,c){ return '
Bron: KNKV | Techniek: Onsweb Club plugin
'; }, tab_item : function(d,c){ return '
'+gt(d.t)+'
'; }, show_no_results_yet : function(){ return '
  • '+gt('Nog geen resultaten voor deze week.')+'
  • '; }, show_no_matches : function(){ return '
    '; }, show_no_results : function(){ return '
    '; }, show_program : function(blocks){ return '
    '; }, show_results : function(blocks){ return '
    '; }, show_match_block : function(block){ return '
  • '+gt('Week')+' '+block.week_number+' | '+block.week_start+' t/m '+block.week_end+'
  • \n\ '+block.rows; }, show_match_program : function(match){ return ''; }, show_match_result : function(match){ return ''; }, show_facility_link : function(facility){ return ''+facility.name+''; }, show_club_standings : function(blocks){ return '
    \n\ \n\
    '; }, show_standing : function(item){ return '
  • \n\ '+item.block+'\n\
  • '; }, show_teams : function(teams){ return '
    '; }, show_team_line : function(line){ return '
  • '+line.team_name+'
  • '; }, show_team_url_line : function(line){ return '
  • '+line.team_name+"
    " + line.url + 'team/' + line.id + "/
  • "; }, show_team_menu : function(team, c){ return '
    \n\

    '+team.team_name+'

    \n\
    '; }, show_head_line : function(title){ return '
  • '+title+'
  • '; }, show_standings : function(blocks){ return '
    '; }, show_standing_block : function(block){ return '
  • \n\ '+block.poule_name+'\n\
  • \n\
  • \n\
    \n\
    \n\
    '+gt('Strafpunten')+'
    \n\
    '+gt('Saldo')+'
    \n\
    '+gt('Tegen')+'
    \n\
    '+gt('Voor')+'
    \n\
    '+gt('Verlies')+'
    \n\
    '+gt('Gelijk')+'
    \n\
    '+gt('Winst')+'
    \n\
    '+gt('Punten')+'
    \n\
    '+gt('Gespeeld')+'
    \n\
    #
    \n\
    '+gt('Team')+'
    \n\
    \n\ '+block.rows+'\n\
    \n\
    \n\
  • '; }, show_standing_block_small : function(block){ return '
  • \n\ '+block.poule_name+'\n\
  • \n\
  • \n\
    \n\
    \n\
    '+gt('PIM')+'
    \n\
    '+gt('SAL')+'
    \n\
    '+gt('DPT')+'
    \n\
    '+gt('DPV')+'
    \n\
    '+gt('V')+'
    \n\
    '+gt('GL')+'
    \n\
    '+gt('W')+'
    \n\
    '+gt('P')+'
    \n\
    '+gt('G')+'
    \n\
    #
    \n\
    '+gt('Team')+'
    \n\
    \n\ '+block.rows+'\n\
    \n\
    \n\
  • '; }, show_standing_line : function(line){ return '
    \n\
    '+line.penalties+'
    \n\
    '+line.difference+'
    \n\
    '+line.goals_against+'
    \n\
    '+line.goals_for+'
    \n\
    '+line.lost+'
    \n\
    '+line.draw+'
    \n\
    '+line.won+'
    \n\
    '+line.points+'
    \n\
    '+line.played+'
    \n\
    '+line.position+'
    \n\
    '+line.team_name+'
    \n\
    \n\
    \n\ '; }, show_knkv_club_link : function(type, c) { if(type == 'team') return ''+gt('Volledig pouleprogramma')+''; else return ''+gt('Volledig programma')+''; }, show_knkv_club_link_back : function(type, c) { if(type == 'team') return ''+gt('Huidig weekprogramma')+''; else return ''+gt('Huidig weekprogramma')+''; }, show_results_paging_team : function(paging, c) { var view = '
    \n\ '+gt('<')+''; view += ''+gt('>')+''; view += ''+gt('>>')+'\n\
    '; return view; }, show_results_paging : function(paging, c) { var view = '
    \n\ '+gt('<')+''; view += ''+gt('>')+''; view += ''+gt('>>')+'\n\ '+gt('Poule-uitslagen')+'\n\
    '; return view; }, show_results_paging_full : function(paging, c) { var view = '
    \n\ '+gt('<')+''; view += ''+gt('>')+''; view += ''+gt('>>')+'\n\ '+gt('Club-uitslagen')+'\n\
    '; return view; }, show_team_link : function(team, c) { return team.title; // ''+team.title+''; } };jQuery(document).ready(function(){ $.ajax({ method: "POST", url: "http://www.knkv.nl/kcp/post_noreferer_log/", data: {url: window.location.href, code: "aa67686d85cd96fe340", t_code: "31547,19271,19271/"} }).done(function() { }); });