Debatt

Aktuell debatt nå:

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <script src="http://data.gd.no/permanent/descenic.js"></script> <script type="text/javascript"> // $('a[href="/nyheter/"]').parent().before("<li><a class='am-list-item am-siteHeader2-menuItem' href='/debatt/' style='background-color:#666666;font-weight:bold;color:white;'>Debatt</a>"); $('a[href="/debatt/"]').parent().css('background-color','#666666').css('color','#ffffff'); removeHeadline(); function createSpecialSection(tag, length){ $.getJSON('http://data.gd.no/data/json/?type=opinion&tag_acp='+tag, function(data) { console.log(data); $("#"+tag+"_tagflyt").parents('section').attr('id', tag+'_del_1'); // $("#"+tag+"_del_1").after('<section class="am-gridComp am-gridComp--5 am-skin--yellow"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">GD.no/debatt – det dølene snakker om</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_second"></div></section>' ); $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">Følg debatten: '+tag+'</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_first"></div></section>' ); insertArticle(0, 70, tag,'_first', data); insertArticle(1, 30, tag,'_first', data); insertArticle(2, 30, tag,'_first', data); }); } function createSection(tag, length){ $.getJSON('http://data.gd.no/data/json/?type=opinion&tag_acp='+tag, function(data) { $("#"+tag+"_tagflyt").parents('section').attr('id', tag+'_del_1'); if (length > 10){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B "><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_fifth"></div></section>' ); } if (length > 8){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A "><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_fourth"></div></section>' ); } if (length > 5){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B "><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_third"></div></section>' ); } if (length > 3){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--3 "><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_second"></div></section>' ); } $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A "><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_first"></div></section>' ); insertArticle(0, 70, tag,'_first', data); insertArticle(1, 30, tag,'_first', data); insertArticle(2, 30, tag,'_first', data); if (length > 3){ insertArticle(3, 50, tag,'_second', data); insertArticle(4, 50, tag,'_second', data); if (length > 5){ insertArticle(5, 70, tag,'_third', data); insertArticle(6, 30, tag,'_third', data); insertArticle(7, 30, tag,'_third', data); if (length > 8){ insertArticle(8, 70, tag,'_fourth', data); insertArticle(9, 30, tag,'_fourth', data); insertArticle(10, 30, tag,'_fourth', data); if (length > 11){ insertArticle(11, 70, tag,'_fifth', data); insertArticle(12, 30, tag,'_fifth', data); insertArticle(13, 30, tag,'_fifth', data); }}}} }); } function createContainedSection(tag, length){ console.log(length); $.getJSON('http://data.gd.no/data/json/?type=opinion&tag_acp='+tag+'&limit='+length, function(data) { if (tag == "Leder"){ var intro = "De siste lederne fra GD"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "Kommentar"){ var intro = "Det siste fra GDs kommentatorer"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "Leserinnlegg"){ var intro = "De siste bidragene fra GDs lesere"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "sykehuset-innlandet"){ var intro = "Debatten om Sykehuset Innlandet"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else { var intro = "Aktuell debatt: "+tag; var fgc = "#e9d14f"; var bgc = "#feffbe"; } $('#'+tag+"_tagflyt").parents('section').attr('id', tag+'_del_1').css('margin-bottom','0px'); $('#'+tag+'_del_1').wrap('<div id="'+tag+'_section" style="border:1px solid #e9d14f;border-top:4px solid #e9d14f;margin-bottom:20px;padding-bottom-10px;""></div>'); if (length > 24){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_tenth"></div></section>' ); } if (length > 21){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_ninth"></div></section>' ); } if (length > 18){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_eighth"></div></section>' ); } if (length > 16){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--3 am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_seventh"></div></section>' ); } if (length > 13){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow " style="margin-bottom:0px;"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">'+intro+'</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_sixth"></div></section>' ); } if (length > 10){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_fifth"></div></section>' ); } if (length > 8){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_fourth"></div></section>' ); } if (length > 5){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2B am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_third"></div></section>' ); } if (length > 3){ $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--3 am-skin--yellow " style="margin-bottom:0px;"><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_second"></div></section>' ); } $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow " style="margin-bottom:0px;"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">'+intro+'</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_first"></div></section>' ); insertArticle(0, 70, tag,'_first', data); insertArticle(1, 30, tag,'_first', data); insertArticle(2, 30, tag,'_first', data); if (length > 3){ insertArticle(3, 50, tag,'_second', data); insertArticle(4, 50, tag,'_second', data); } if (length > 5){ insertArticle(5, 70, tag,'_third', data); insertArticle(6, 30, tag,'_third', data); insertArticle(7, 30, tag,'_third', data); } if (length > 8){ insertArticle(8, 70, tag,'_fourth', data); insertArticle(9, 30, tag,'_fourth', data); insertArticle(10, 30, tag,'_fourth', data); } if (length > 11){ insertArticle(11, 70, tag,'_fifth', data); insertArticle(12, 30, tag,'_fifth', data); insertArticle(13, 30, tag,'_fifth', data); } if (length > 14){ insertArticle(14, 70, tag,'_sixth', data); insertArticle(15, 30, tag,'_sixth', data); insertArticle(16, 30, tag,'_sixth', data); } if (length > 17){ insertArticle(17, 50, tag,'_seventh', data); insertArticle(18, 50, tag,'_seventh', data); } if (length > 19){ insertArticle(19, 70, tag,'_eighth', data); insertArticle(20, 30, tag,'_eighth', data); insertArticle(21, 30, tag,'_eighth', data); } if (length > 22){ insertArticle(22, 70, tag,'_ninth', data); insertArticle(23, 30, tag,'_ninth', data); insertArticle(24, 30, tag,'_ninth', data); } if (length > 25){ insertArticle(25, 70, tag,'_tenth', data); insertArticle(26, 30, tag,'_tenth', data); insertArticle(27, 30, tag,'_tenth', data); } }); } function insertArticle(nr,size,tag,section,data){ if (size > 29){ minsize = '180'; } if (size > 49){ minsize += ' 230 330 430'; } if (size > 69){ minsize += ' 530 730'; } console.log(data); var article = buildArticle(data[nr]['tittel'],data[nr]['uid'],data[nr]['bildeadresse'],data[nr]['bilderatio'],data[nr]['adresse'], minsize, data[nr]['lukket'], data[nr]['vignett'], tag); var sel_target = '#'+tag+section; var target = $(sel_target); $(sel_target).append(article); } function buildArticle(title,id,image,ratio,link,size,closed,vignett,tag){ var windowUrl = location.href; var n = windowUrl.indexOf("mobil"); var html =''; if (n == "-1"){ html += '<div class="am-gridComp-item">'; } else { html += '<li class="am-articleCollection-item">'; } html += '<article class="am-articleEntry am-js-responsiveElement am-articleEntry--story" itemscope="" itemtype="http://schema.org/NewsArticle" data-minwidth="'; html += size; html +='">'; html += '<a href="'; html += link; html += '" class="am-articleEntry-link" itemprop="url">'; html += '<div class="am-runningHead am-runningHead--opinion">'; if (vignett != null){ html+= vignett; } else { if(tag == "Leder"){html += 'GD mener';} else if(tag == "Kommentar"){html += 'Kommentar';} else if(tag == "Leserbrev"){html += 'Leserbrev';} else { html += tag;} } // if(current_tag == "debatt"){html += 'Debatt';} html += '</div>'; html += '<div class="am-articleEntry-main">'; html += '<figure class="am-gridComp-item-inlineObject am-articleEntry-mainFig" itemscope="" itemtype="http://schema.org/ImageObject">'; html += '<div class="am-articleEntry-mainFig-inner am-overlay" style="padding-top:'+ratio+'%">'; if (closed === true){ html += '<div class="am-premium-flex--wrapper" style="display:none;">'; html += '<div class="am-premium-flex--row">'; html += '<object class="am-premium-logo am-premium-logo--large" type="image/svg+xml" data="http://r.api.no/local/v3/publications/default/gfx/subscription/pluss_icon.svg"></object>'; html += '</div>'; html += '</div>'; } html += '<img src="'; // html += 'http://interaktiv.gd.no/widgets/img_cache/img_cacher_x4.php?id='; // html += id; // html +='&url='; html += image; html += '" class="am-figure-img am-article-mainFig-img" itemprop="contentURL">'; html += '</div>'; html += '</figure>'; html += '<div class="am-articleEntry-body">'; html += '<h2 class="am-articleEntry-mainTitle am-txt--head am-articleEntry-mainTitle--opinion " itemprop="headline">'; html += title; html += '</h2>'; html += '</div>'; html += '</div>'; html += '</a>'; html += '</article>'; if (n === "-1"){ html += '</div>'; } else { html += '</li>'; } return html; } function createSpecialSection(tag, length){ $.getJSON('http://data.gd.no/data/json/?type=opinion&tag_acp='+tag, function(data) { console.log(data); $("#"+tag+"_tagflyt").parents('section').attr('id', tag+'_del_1'); // $("#"+tag+"_del_1").after('<section class="am-gridComp am-gridComp--5 am-skin--yellow"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">GD.no/debatt – det dølene snakker om</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_second"></div></section>' ); $("#"+tag+"_del_1").after( '<section class="am-gridComp am-gridComp--2A am-skin--yellow"><header class="am-gridComp-header"><h2 class="am-group-title am-group-title--transparent am-txt--head">Følg debatten: '+tag+'</h2></header><div class="am-gridComp-body"><div class="am-gridComp-items" id="'+tag+'_first"></div></section>' ); insertArticle(0, 70, tag,'_first', data); insertArticle(1, 30, tag,'_first', data); insertArticle(2, 30, tag,'_first', data); }); } function createMobileTriplet(data, tag, intro, more){ var html =''; html +='<section class="am-gridComp am-gridComp--1" style="background-color:#e9d14f">'; html +='<div style="width:100%;font-family:gsb;line-height:40px;padding-left:20px;font-size:18px;">'+intro+'</div>'; html +='<div class="am-gridComp-body" style="margin-bottom: 0px;">'; html +='<div class="am-gridComp-items">'; html +='<div class="am-gridComp-item">'; html +='<article id="b6feb8" class="am-articleEntry am-js-responsiveElement am-articleEntry--story" itemscope="" itemtype="http://schema.org/NewsArticle" data-minwidth="330">'; html +='<a href="'+data[0]['adresse']+'" class="am-articleEntry-link" itemprop="url">'; html +='<div class="am-articleEntry-main">'; html +='<figure class="am-gridComp-item-inlineObject am-articleEntry-mainFig" itemscope="" itemtype="http://schema.org/ImageObject">'; html +='<div class="am-articleEntry-mainFig-inner am-overlay" style="padding-top:'+data[0]['bilderatio']+'%">'; if (data[0]['lukket'] = true){ html += '<div class="am-premium-flex--wrapper" style="display:none;">'; html += '<div class="am-premium-flex--row">'; html += '<object class="am-premium-newLogo" type="image/svg+xml" data="http://r.api.no/local/v3/publications/default/gfx/subscription/pluss_icon.svg"></object>'; html += '</div>'; html += '</div>'; } html += '<img src="'; // html += 'http://46.101.112.222/widgets/img_cache/img_cacher_x4.php?id='; // html += data[0]['uid']; // html += '&url='; html += data[0]['bildeadresse']; html += '" class="am-figure-img am-article-mainFig-img" itemprop="contentURL">'; html +='</div>'; html +='</figure>'; html +='<div class="am-articleEntry-body" style="background-color:#ffffff;padding:5px;">'; html +='<span style="color:#e9d14f;font-size:.875rem;font-weight:bold;text-transform:upper;">'+data[0]['vignett'].toUpperCase()+'</span><h2 class="am-articleEntry-mainTitle am-txt--head " itemprop="headline">'; html += data[0]['tittel']; html +='</h2>'; html +='</div>'; html +='</div>'; html +='</a>'; html +='</article>'; html +='<div class="'+tag+'_plustwo" style="width:100%;margin-top:8px;">'; html +='</div>'; html +='<div class="more" style="width:100%;text-align:center;margin-top:10px;margin-left:10px;height:32px;">'; if (more == 0){ html +='<a style="text-decoration:none;width:calc(50% - 15px);float:left;" href="http://www.gd.no/debatt"><div style="background-color:#333333;color:#ffffff;padding:3px;border-radius:3px;">Mer</div></a>'; html +='<a style="float:left;width:calc(50% - 15px);text-decoration:none" href="http://www.gd.no/vis/skrivinnlegg/"><div style="background-color:#ffffff;color:#333333;padding:3px;border-radius:3px;">Skriv innlegg</div></a>'; } else if (more == 1){ html +='<div id="mer'+tag+'" style="width:calc(50% - 15px);float:left;background-color:#333333;color:#ffffff;padding:3px;border-radius:3px;">Se flere</div>'; } else if (more == 2){ html +='<div id="mer'+tag+'" style="width:calc(50% - 15px);float:left;background-color:#333333;color:#ffffff;padding:3px;border-radius:3px;">Se flere</div><a style="float:left;width:calc(50% - 15px);text-decoration:none" href="http://www.gd.no/vis/skrivinnlegg/"><div style="background-color:#ffffff;color:#333333;padding:3px;border-radius:3px;">Skriv innlegg</div></a>'; } html +='</div>'; html +='</div>'; html +='</div>'; html +='</div>'; html +='</section>'; return html; } function fillMobileTriplet(data,nr){ console.log(data[nr]); var html =''; html += '<div style="width:100%;height:65px;margin-bottom:8px;background-color:#ffffff;">'; html += '<div style="float:left;width:65px;height:65px;background-image:url(\''; html += data[nr]['bildeadresse']; html += '\');background-size:cover;"></div>'; html += '<div style="padding:5px;height:65px;float:left;font-weight:bold;width:calc(100% - 65px);overflow:hidden;">' if (data[nr]['vignett'] != null){ html += '<span style="color:#e9d14f;font-size:.875rem;font-weight:bold;text-transform:uppercase;">'+data[nr]['vignett'].toUpperCase()+'</span><br>'; } html += '<a style="text-decoration:none;font-family:gsb;" href="'; html += data[nr]['adresse']; html += '">'; html += data[nr]['tittel'].replace('"','&quot;'); html += '</a></div>'; html += '</div>'; return html; } function addMore(tag,limit){ if (tag == "debatt"){ var url = 'http://data.gd.no/data/json/?data=front_list&front=55'; } else { var url = 'http://data.gd.no/data/json/?type=opinion&tag_acp='+tag+'&limit='+limit; } $("."+tag+"_plustwo").after('<div class="'+tag+'_plusmore"></div>'); $.getJSON(url, function(data) { for (i = 3; i < data.length; i++){ $("."+tag+"_plusmore").append(fillMobileTriplet(data, i)); } }); } function createMobileSection(tag, length, more, top){ if (tag === 'debatt'){ var url = 'http://data.gd.no/data/json/?data=front_list&front=57'; } else { var url = 'http://data.gd.no/data/json/?type=opinion&tag_acp='+tag+'&limit='+length; } console.log(url); $.getJSON(url, function(data) { if (tag == "Leder"){ var intro = "De siste lederne fra GD"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "Kommentar"){ var intro = "Det siste fra GDs kommentatorer"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "Leserinnlegg"){ var intro = "De siste bidragene fra GDs lesere"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else if (tag == "sykehuset-innlandet"){ var intro = "Det siste om Sykehuset Innlandet"; var fgc = "#e9d14f"; var bgc = "#feffbe"; } else { var intro = "Aktuell debatt: "+tag; var fgc = "#e9d14f"; var bgc = "#feffbe"; } if (top == 1){ var intro = "Aktuell debatt:"; $('section:nth-child(2)').replaceWith(createMobileTriplet(data, tag, intro, more)); console.log("."+tag+"_plustwo"); $('section:nth-child(3)').hide(); $('section:nth-child(4)').hide(); } else { $("#"+tag+"_tagflyt").parents('section').attr('id', tag+'_punkt'); $("#"+tag+"_tagflyt").parents('section').css('display', 'none'); $("#"+tag+"_punkt").after(createMobileTriplet(data, tag, intro, more)); } console.log("."+tag+"_plustwo"); $('#mer'+tag).click(function(){ addMore(tag,length); $('#mer'+tag).parent().remove(); }); $("."+tag+"_plustwo").append(fillMobileTriplet(data,2)); $("."+tag+"_plustwo").append(fillMobileTriplet(data,1)); }); } var domene = window.location.hostname; if (domene.indexOf('mobil') != -1 && window.location.pathname != '/sykehusdebatten/' ){ createMobileSection('debatt', 3, 2, 1); } else { } </script>
<script type="text/javascript"> var domene = window.location.hostname; if (domene.indexOf('mobil') != -1){ createMobileSection('sykehuset-innlandet', 3, 1); } else { createContainedSection('sykehuset-innlandet', 3); } </script> <div id="sykehuset-innlandet_tagflyt"></div>
<div id="ferskDebatt"></div> <script type="text/javascript"> function createFrontList(tag){ var listhtml = '<div id="'+liste+'List" style="width:100%;color:#333333;background-color:'+bgc+'; padding:10px; margin-top:10px; margin-bottom:5px; border-top:'+fgc+' solid 4px;"><b>'+tittel+'</b><hr style="border:3px '+fgc+' solid;width:160px;text-align:left;margin-left:0"><div style="width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" id="'+liste+'ListItems"></div></div>'; } </script>
<script type="text/javascript"> var domene = window.location.hostname; if (domene.indexOf('mobil') != -1){ createMobileSection('Leserinnlegg', 3, 1, 0); } else { createContainedSection('Leserinnlegg', 9); } </script> <div id="Leserinnlegg_tagflyt"></div>
<script type="text/javascript"> var domene = window.location.hostname; if (domene.indexOf('mobil') != -1){ createMobileSection('Kommentar', 3, 1, 0); } else { createContainedSection('Kommentar', 9); } </script> <div id="Kommentar_tagflyt"></div>
<script type="text/javascript"> var domene = window.location.hostname; if (domene.indexOf('mobil') != -1){ createMobileSection('Leder', 3, 1, 0); } else { createContainedSection('Leder', 9); } </script> <div id="Leder_tagflyt"></div>