Universitas Udayana, Kampus Terbaik di Denpasar versi QS AUR 2023

Lihat Foto

Universitas Udayana, Kampus Terbaik di Denpasar versi QS AUR 2023(Dok. Universitas Udayana)

Universitas Udayana, Kampus Terbaik di Denpasar versi QS AUR 2023

KOMPAS.com - Calon mahasiswa yang ingin kuliah di Universitas Udayana (Unud) perlu mencari tahu soal biaya kuliah yang diperlukan.

Melansir dari laman resmi Unud, Selasa (14/3/2023) biaya kuliah di Universitas Udayana terdiri dari Uang Kuliah Tunggal (UKT) yang dibayarkan calon mahasiswa di semua jalur masuk Unud.

UKT berfungsi memberi subsidi silang yang didasarkan pada kondisi ekonomi dan sosial orangtua/wali setiap mahasiswa.

Jadi sistem ini mengacu kepada pendapatan orangtua mahasiswa, semakin tinggi pendapatan orangtua maka semakin tinggi pula UKT yang harus dibayar. Sebaliknya semakin rendah penghasilan orangtua maka semakin rendah pula biaya UKT yang harus dibayarkan.

Baca juga: Biaya Kuliah ITB Jalur SNMPTN atau SNBP 2023, Mulai Rp 0

Biaya UKT Universitas Udayana

Komponen pembiayaan UKT ini diharapkan dapat memberikan dampak pemerataan untuk setiap mahasiswa dan membantu mahasiswa yang berasal dari keluarga kurang mampu.

UKT ditentukan berdasarkan kondisi ekonomi keluarga. Sebelum memasuki perkuliahan, calon mahasiswa akan mengisi form online untuk menentukan nilai nominal UKT.

Nilai UKT ditinjau dari pendapatan orangtua per bulan, gaji dan tunjangan, rekening listrik, rekening PDAM, PBB luas tanah, banyak rumah, banyak mobil, banyak motor, dan sebagainya.

Besaran UKT di Universitas Udayana mengikuti peraturan dan keputusan yang telah ditetapkan oleh Pemerintah yang sebelumnya Kemenristekdikti dan setelah perubahan mengikuti Kemendikbud Ristek.

Merangkum dari keputusan rektor Universitas Udayana Nomor 475/UN14/HK/2022 tentang Uang Kuliah Tunggal (UKT) mahasiswa program Diploma dan Sarjana di Universitas Udayana, Selasa (14/3/2023), berikut Kompas.com rangkumkan biaya UKT dari kelompok I (paling rendah) hingga UKT kelompok V (paling tinggi) yang perlu dibayarkan para calon mahasiswa per semester.

Baca juga: Besaran Biaya Kuliah ITS Jalur SNBP dan SNBT 2023, Mulai Rp 500.000

1. Fakultas Ekonomi dan Bisnis

  • D3 Akuntansi: Rp 500.000 - Rp 4 juta
  • D3 Perpajakan: Rp 500.000 - Rp 4 juta
  • S1 Akuntansi: Rp 500.000 - Rp 6 juta
  • S1 Ekonomi: Rp 500.000 - Rp 6 juta
  • S1 Manajemen: Rp 500.000 - Rp 6 juta

2. Fakultas Hukum

  • S1 Ilmu Hukum: Rp 500.000 - Rp 5,1 juta

3. Fakultas Ilmu Sosial dan Ilmu Politik

  • S1 Administrasi Publik: Rp 500.000 - Rp 5 juta
  • S1 Hubungan Internasional: Rp 500.000 - Rp 5,5 juta
  • S1 Ilmu Komunikasi: Rp 500.000 - Rp 5,5 juta
  • S1 Ilmu Politik: Rp 500.000 - Rp 5 juta
  • S1 Sosiologi: Rp 500.000 - Rp 5 juta
  • D3 Perpustakaan: Rp 500.000 - Rp 4,6 juta

4. Fakultas Kedokteran

  • S1 Kedokteran: Rp 500.000 - Rp 23.240.000
  • S1 Fisioterapi: Rp 500.000 - Rp 13,5 juta
  • S1 Ilmu Keperawatan: Rp 500.000 - Rp 9,7 juta
  • S1 Kesehatan Masyarakat: Rp 500.000 - Rp 9,1 juta
  • S1 Kedokteran Gigi: Rp 500.000 - Rp 21.350.000
  • S1 Psikologi: Rp 500.000 - Rp 7,9 juta


Baca juga: Biaya Kuliah D3-S1 di UII Yogyakarta Tahun 2023/2024

5. Fakultas Kedokteran Hewan

  • S1 Kedokteran Hewan: Rp 500.000 - Rp 7,5 juta

6. Fakultas Kelautan dan Perikanan

  • S1 Manajemen Sumber Daya Perairan: Rp 500.000 - Rp 5,5 juta
  • S1 Ilmu Kelautan: Rp 500.000 - Rp 5,5 juta

7. Fakultas MIPA

  • S1 Matematika: Rp 500.000 - Rp 5,2 juta
  • S1 Biologi: Rp 500.000 - Rp 6 juta
  • S1 Fisika: Rp 500.000 - Rp 3,5 juta
  • S1 Kimia: Rp 500.000 - Rp 6 juta
  • S1 Informatika: Rp 500.000 - Rp 7 juta
  • S1 Farmasi: Rp 500.000 - Rp 7 juta

8. Fakultas Pariwisata

  • D4 Pengelolaan Perhotelan: Rp 500.000 - Rp 6,5 juta
  • S1 Pariwisata: Rp 500.000 - Rp 5 juta
  • S1 Industri Perjalanan Wisata: Rp 500.000 - Rp 5 juta

9. Fakultas Pertanian

  • S1 Agribisnis: Rp 500.000 - Rp 4,5 juta
  • S1 Agroekoteknologi: Rp 500.000 - Rp 4,5 juta
  • S1 Arsitektur Lanskap: Rp 500.000 - Rp 4,5 juta

10. Fakultas Peternakan

  • S1 Peternakan: Rp 500.000 - Rp 4,5 juta

11. Fakultas Ilmu Budaya

  • S1 Antropologi Budaya: Rp 500.000 - Rp 3 juta
  • S1 Arkeologi: Rp 500.000 - Rp 3 juta
  • S1 Ilmu Sejarah: Rp 500.000 - Rp 3 juta
  • S1 Sastra Bali: Rp 500.000 - Rp 3 juta
  • S1 Sastra Indonesia: Rp 500.000 - Rp 3 juta
  • S1 Sastra Inggris: Rp 500.000 - Rp 5 juta
  • S1 Sastra Jawa Kuna: Rp 500.000 - Rp 3 juta
  • S1 Sastra Jepang: Rp 500.000 - Rp 5 juta

12. Fakultas Teknik

  • S1 Arsitektur: Rp 500.000 - Rp 8 juta
  • S1 Teknik Elektro: Rp 500.000 - Rp 8 juta
  • S1 Teknik Mesin: Rp 500.000 - Rp 8 juta
  • S1 Teknik Sipil: Rp 500.000 - Rp 8 juta
  • S1 Teknologi Informasi: Rp 500.000 - Rp 8 juta
  • S1 Teknik Lingkungan: Rp 500.000 - Rp 8 juta
  • S1 Teknik Industri: Rp 500.000 - Rp 8 juta

13. Fakultas Teknologi Pertanian

  • S1 Teknologi Pangan: Rp 500.000 - Rp 5.750.000
  • S1 Teknik Pertanian dan Biosistem: Rp 500.000 - Rp 5.750.000
  • S1 Teknologi Industri Pertanian: Rp 500.000 - Rp 5.750.000

Baca juga: Untar Masuk Top 10 Kampus Swasta Klaster Mandiri 2023 dari Kemendikbud

Biaya SPI Universitas Udayana

Sedangkan calon mahasiswa yang berhasil masuk Unud lewat jalur Mandiri, selain UKT juga ada komponen pembiayaan Sumbangan Pengembangan Institusi (SPI).

Biaya kuliah SPI di Udayana ini sesuai dengan kelompok Sumbangan Pengembangan Institusi yang telah ditetapkan.

Untuk biaya kuliah SPI terdiri dari 8 kelompok. Besaran SPI 0 paling kecil Rp 0. Kemudian dari SPI 1 hingga SPI 8 besaran SPI yang dibayarkan untuk masing-masing jurusan memiliki nomimal yang berbeda-beda.

Berikut besaran SPI di Universitas Udayana yang perlu diketahui calon mahasiswa:

1. Fakultas Teknik

  • S1 Arsitektur: Rp 17 juta - Rp 228 juta
  • S1 Teknik Elektro: Rp 9 juta - Rp 114 juta
  • S1 Teknik Mesin: Rp 9 juta - Rp 114 juta
  • S1 Teknik Sipil: Rp 17 juta - Rp 228 juta
  • S1 Teknologi Informasi: Rp 17 juta - Rp 228 juta
  • S1 Teknik Lingkungan: Rp 9 juta - Rp 114 juta
  • S1 Teknik Industri: Rp 9 juta - Rp 114 juta

2. Fakultas Ilmu Budaya

  • S1 Sastra Inggris: Rp 15 juta - Rp 190 juta
  • S1 Sastra Jepang: Rp 9 juta - Rp 114 juta

3. Fakultas Kedokteran

  • S1 Kedokteran: Rp 85 juta - Rp 1,2 miliar
  • S1 Fisioterapi: Rp 6 juta - Rp 76 juta
  • S1 Ilmu Keperawatan: Rp 17 juta - Rp 228 juta
  • S1 Kesehatan Masyarakat: Rp 9 juta - Rp 114 juta
  • S1 Kedokteran Gigi: Rp 71 juta - Rp 950 juta
  • S1 Psikologi: Rp 500.000 - Rp 7,9 juta

4. Fakultas Hukum

  • S1 Ilmu Hukum: Rp 15 juta - Rp 190 juta

5. Fakultas Pertanian

  • S1 Agribinis: Rp 6 juta - Rp 76 juta
  • S1 Agroekoteknologi: Rp 6 juta - Rp 76 juta
  • S1 Arsitektur Lanskap: Rp 6 juta - Rp 76 juta

6. Fakultas Peternakan

  • S1 Peternakan: Rp 6 juta - Rp 76 juta

7. Fakultas Ekonomi dan Bisnis

  • S1 Ekonomi: Rp 15 juta - Rp 190 juta
  • S1 Manajemen: Rp 20 juta - Rp 200 juta
  • S1 Akuntansi: Rp 20 juta - Rp 200 juta

Baca juga: 5 Beasiswa ke Luar Negeri Tanpa Syarat IPK Tinggi, Bisa Kuliah Gratis

8. Fakultas MIPA

  • S1 Kimia: Rp 6 juta - Rp 76 juta
  • S1 Fisika: Rp 6 juta - Rp 76 juta
  • S1 Biologi: Rp 6 juta - Rp 76 juta
  • S1 Matematika: Rp 6 juta - Rp 76 juta
  • S1 Farmasi: Rp 30 juta - Rp 442 juta
  • S1 Informatika: Rp 17 juta - Rp 228 juta

9. Fakultas Kedokteran Hewan

  • S1 Kedokteran Hewan: Rp 15 juta - Rp 190 juta

10. Fakultas Teknologi Pertanian

  • S1 Teknik Pertanian: Rp 6 juta - Rp 76 juta
  • S1 Teknologi Pangan: Rp 6 juta - Rp 76 juta
  • S1 Teknologi Industri Pertanian: Rp 6 juta - Rp 76 juta

11. Fakultas Pariwisata

  • D4 Pengelolaan Perhotelan: Rp 6 juta - Rp 76 juta
  • S1 Pariwisata: Rp 9 juta - Rp 114 juta
  • S1 Industri Perjalanan Wisata: Rp 9 juta - Rp 114 juta

12. Fakultas Ilmu Sosial dan Ilmu Politik

  • S1 Administrasi Publik: Rp 15 juta - Rp 190 juta
  • S1 Hubungan Internasional: Rp 15 juta - Rp 190 juta
  • S1 Ilmu Komunikasi: Rp 15 juta - Rp 190 juta
  • S1 Ilmu Politik: Rp 12 juta - Rp 152 juta
  • S1 Sosiologi: Rp 12 juta - Rp 152 juta

13. Fakultas Kelautan dan Perikanan

  • S1 Manajemen Sumber Daya Perairan: Rp 12 juta - Rp 152 juta
  • S1 Ilmu Kelautan: Rp 12 juta - Rp 152 juta.

Baca juga: Biaya Sekolah SMA Taruna Nusantara, Bisa Tanpa Uang Pangkal

Demikian biaya kuliah baik UKT maupun SPI yang wajib dibayarkan calon mahasiswa yang ingin melanjutkan pendidikan di Universitas Udayana. Untuk informasi lebih lengkap mengenai biaya kuliah Unud bisa dicek di laman ini.

Dapatkan update berita pilihan dan breaking news setiap hari dari Kompas.com. Mari bergabung di Grup Telegram "Kompas.com News Update", caranya klik link , kemudian join. Anda harus install aplikasi Telegram terlebih dulu di ponsel.  

Pilihan Untukmu

`); var wSpecStop = createElementFromHTML(`

Konten disembunyikan.
Muat ulang halaman untuk perbarui rekomendasi.

`); reactionPopup.querySelector('.buttonShare').setAttribute('data-title', item.title); reactionPopup.querySelector('.buttonShare').setAttribute('data-url', itemUrl); reactionPopup.querySelector('.buttonShare').setAttribute('data-campaign', 'AIML_Widget_Desktop'); let userFeedback = new UserFeedback(resultObj.engine['tracker_algsrc'], itemUrl + tracker_params, jxRecHelper, index); reactionPopup.querySelector('.buttonBookmark').addEventListener('click', function() { do_bookmark(itemUrl, index, userFeedback); }); reactionPopup.querySelector('.buttonShare').addEventListener('click', function() { userFeedback.event('share'); }); reactionPopup.querySelector('.buttonNotInterest').addEventListener('click', function() { if (getCookie('kmps_usrid')) { hideThisArt(this); userFeedback.event('not-interested'); } else { const parentAction = this.parentElement.parentElement.parentElement if (!!parentAction) { let indexElement = parentAction.getAttribute('data-index') if (indexElement != 'undefined') { localStorage.setItem('reaction_not_interest_temp', JSON.stringify({ urlpage: items[indexElement].url })) } } window.location.href = "" + btoa(window.location.href); } }); /** * trigger action "userFeedback" that user not interest item before, when not interest without login */ if (getCookie('kmps_usrid') && localStorage.getItem('reaction_not_interest_temp')) { const tempUrlNotInterest = JSON.parse(localStorage.getItem('reaction_not_interest_temp')) if (itemUrl == tempUrlNotInterest.urlpage) { userFeedback.event('not-interested'); localStorage.removeItem('reaction_not_interest_temp'); } } wSpecStop.querySelector('.wSpec-stop-undo').addEventListener('click', function() { showThisArt(this); userFeedback.event('un-not-interested'); }); recItem.appendChild(buttonOption); recItem.appendChild(reactionPopup); recItem.appendChild(wSpecStop); } var recItemWrapperA = createElement('a', null, null, null); recItemWrapperA.setAttribute('href', itemUrl + tracker_params); var titleDiv = createElement('h4', null, null, [cssClasses.title]); var titleTextNode = document.createTextNode(item.title); if (item.itemType == 'video') { var iconVideo = createElement('div', null, null, ['icoInline', 'icoVideo']); iconVideo.style.marginRight = '5px'; titleDiv.appendChild(iconVideo); } titleDiv.appendChild(titleTextNode); var sourceDiv = null; if (item.hasOwnProperty('method')) { sourceDiv = createElement('div', null, null, [cssClasses.source], resultObj.engine['type'] + ' . ' + item.method.toUpperCase()); } else { var sourceDiv = createElement('div', null, null, [cssClasses.source], resultObj.engine['type']); } var textWrapper = createElement('div', null, null, [cssClasses.text_wrapper]); textWrapper.appendChild(categoryDiv); textWrapper.appendChild(titleDiv); textWrapper.appendChild(sourceDiv); recItemWrapper.appendChild(imgWrapper); recItemWrapper.appendChild(textWrapper); recItemWrapperA.appendChild(recItemWrapper); recItem.appendChild(recItemWrapperA); widgetWrapper.appendChild(recItem); // hook up the click handler for this item // recItem.onclick = handleClick.bind(null, jxRecHelper, itemUrl + tracker_params, index); recItemWrapperA.onclick = handleClick.bind(null, jxRecHelper, itemUrl + tracker_params, index); }); } // end while var endDate = new Date(); var loadtime = (endDate.getTime() - startDate.getTime()); trackEventGa('AIML Article Recommendation', 'Content Loaded', 'algsrc='+algsrc+',site=EDUKASI,device=desktop,loadtime=' + loadtime) let domain = window.location.hostname; if(domain=='){ var url=window.location.href.split("/"); domain=url[2]+'/'+url[3] } let user_subs_type = "Gues"; let subs_type = ""; let is_lgn = 0; let engine = algsrc; if(getCookie('kmps_usrid')){is_lgn=1}; let time_load = loadtime; resolve(); /*** * JXRECSDK NOTES 3 of 5 - * pass all the info about the items to the rec helper * each one is an object: ALL MANDATORY * div * id * pos */ jxRecHelper.items(widgetItemArr); /*** * JXRECSDK NOTES 4 of 5 - * Call the ready() of the helper object when the recommendation * results have been populated to the widget * (This will register the action=ready event) */ if (resultObj.engine['type'] == 'api-1') { jxRecHelper.ready(resultObj.options.algo + ":" + resultObj.options.version); } else { jxRecHelper.ready(resultObj.engine['type']); } } else { jxRecHelper.error(204); console.error("Error: no recommendation items"); return; } } catch (err) { jxRecHelper.error(901); console.log(err.stack); let domain = window.location.hostname; if(domain=='){ var url=window.location.href.split("/"); domain=url[2]+'/'+url[3] } let user_subs_type = "Gues"; let subs_type = "" let is_lgn = 0; let engine = algsrc; if(getCookie('kmps_usrid')){is_lgn=1}; let endDate = new Date(); let time_load = (endDate.getTime() - startDate.getTime()); } }); } const _jxRecSdkURL = ' var startDate = new Date(); class OneWidget { constructor() { //this is also the one we will pass to the JX rec helper object when //we instantiate it: //In this implementation most of these come from the options obj //on the publisher page. this._options = { accountid: '9262bf2590d558736cac4fff7978fcb1', pageurl: ' widget_id: '1000183-6xWeiWZFIM', type: 'pages', container: 'rekomendasi-konten-pilihan-untukmu-aiml', keywords: content_tags, title: title, customid: "71", count: 14, }; this._containerId = this._options.container; this._container = document.getElementById(this._containerId); this._engines = [{"url":"https:\/\/recommendation.jixie.media\/v1\/recommendation","method":"GET","pageurl":"https:\/\/","system":"jx","type":"api-1","tracker_params":"?source=widgetML","tracker_algsrc":"V","count":14,"page_status":"read","excludeitemids":"20230314111713271"}]; } kickOff() { startDate = new Date(); const rand = Math.floor(Math.random() * 1000); /*const randSystem = Math.floor(Math.random() * 3); this._engine = this._engines[randSystem] if (location.hostname.indexOf('lestari') != -1) { this._engine = this._engines[1] }*/ this._engine = this._engines[0]; this._options.system = this._engine['system'] trackEventGa('AIML Article Recommendation', 'Widget load', 'algsrc=' + this._engine['tracker_algsrc'] + ',site=EDUKASI,device=desktop') let promJXSDK = fetchJSFileP(_jxRecSdkURL); let thisObj = this; // first we wait on the JX REC SDK to be loaded and initialized let recHelperObj = null; let recResults = null; promJXSDK .then(function() { /*** * JXRECSDK NOTES 1 of 5 - INSTANTIATION OF A JX REC HELPER OBJECT * Call this AFTER JX REC SDK is loaded but BEFORE you call your REC * backend. * * param: MANDATORY options object * options object must at a minimal have * accountid: get from jixie * widgetid: get from jixie * container: DIV ID of the destination div to house the widget * (for jixie widget this is just the options object passed from the page) * * (This will also register the action=load event) */ recHelperObj = jxRecMgr.createJxRecHelper(thisObj._options); let basicInfo = thisObj._options; basicInfo.engine = thisObj._engine if (basicInfo.engine.type == 'api-1') { var options = { count: basicInfo['count'], adpositions: "", keywords: basicInfo['keywords'], title: basicInfo['title'], date_published: "2023-03-14", pagecategory: "EDUKASI", algo: "mixed" }; if(getCookie('kmps_usrid')){ var kg = { pagetype:basicInfo.engine.page_status, uid:getCookie('kmps_usrid'), ukid:getCookie('kmp_uid') } if(basicInfo.engine.page_status=='read'){ kg['excludeitemids'] = basicInfo.engine.excludeitemids; kg['multiFormat'] = true; } options['additional'] = { kg:kg }; } return recHelperObj.getJxRecommendations(options); } else { return fetchRecommendationsP(basicInfo, recHelperObj.getJxUserInfo()); } }) .then(function(resp) { if (thisObj._engine.type == 'api-3') { recResults = new Object recResults.items = resp.docs.result; } else { recResults = resp; } recResults.engine = thisObj._engine; if (!resp || !recResults.items || recResults.items.length == 0) { /*** * JXRECSDK NOTES 2 of 5 - * Call the error() function on the recHelper when either an error * has occured in the fetching or there are no recommended items * * (This will register the action=error event) */ recHelperObj.error(204); throw "no recommendation results"; } }) .then(function() { // everything is ready (recommendation results, css): document.getElementById("rekomendasi-konten-pilihan-untukmu-aiml").classList.remove("-loading"); document.querySelector('.wSpec-list').remove(); createDisplay(rand, thisObj._container, recResults, recHelperObj) .then(function() { toggleDropdown(); //observe lozad lozad('.lozad', { load: function(el) { el.src = el.dataset.src; el.onload = function() { el.classList.add('fade') } } }).observe() }) }) .catch(function(error) { console.log(`Unable to create recommendations widget ${error.stack} ${error.message}`); }); } } var limit_gtm_ready = 1; function check_gtm_ready() { if ('ga' in window) { // create a new instance of our widget based on the options const newW = new OneWidget(); newW.kickOff(); } else { const timeout_gtm_ready = setTimeout(check_gtm_ready, 500) limit_gtm_ready += 1; if (limit_gtm_ready > 10) { clearTimeout(timeout_gtm_ready); const newW = new OneWidget(); newW.kickOff(); } } } check_gtm_ready() document.querySelector('.wSpec-secret').addEventListener('click', function(e) { e.preventDefault(); let wSl = document.querySelectorAll('.wSpec-source'); if (wSl.length > 0) { for (let i = 0; i < wSl.length; i++) { wSl[i].classList.toggle('show') } } }) function trackEventGa(category, action, label) { if ("ga" in window) { ga(function() { tracker = ga.getAll()[0]; if (tracker) { tracker.send("event", category, action, label); console.log('track event ', category, action, label) } }) } } function formBody(obj) { let formBody = []; for (var property in obj) { let encodedKey = encodeURIComponent(property); let encodedValue = encodeURIComponent(obj[property]); formBody.push(encodedKey + "=" + encodedValue); } return formBody.join("&"); } function getCookie(name) { var name = name + '='; var cookies = decodeURIComponent(document.cookie).split(';'); for (var i = 0; i < cookies.length; i++) { var c = cookies[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } } function get_guid(url) { const videoPath = url.match(/\/watch\/(\d+)/); if (videoPath) { return `video.${videoPath[1]}`; } let arrayUrl = url.split('/'); let readPath = arrayUrl.indexOf('read'); if (arrayUrl[readPath + 1] == 'xml') { readPath += 1; } let year = arrayUrl[readPath + 1]; let month = arrayUrl[readPath + 2]; let date = arrayUrl[readPath + 3]; let id = arrayUrl[readPath + 4]; let guid = `.xml.${year}.${month}.${date}.${id}`; return guid; } function toggleDropdown() { let tdd = document.querySelectorAll('[data-dropdown]') if (!!tdd) { tdd.forEach((el) => { el.addEventListener('click', function() { el.parentElement.classList.toggle('-active') let saved = el.parentElement.getAttribute('data-saved') let kmps_usrid = getCookie('kmps_usrid'); if (kmps_usrid && !saved && el.parentElement.classList.contains('-active')) { let url = el.parentElement.getAttribute('data-url'); let guid = get_guid(url); check_bookmark( kmps_usrid, guid ).then(function(resp) { if (resp.hasOwnProperty('total_data')) { if (resp.total_data > 0) { el.parentElement.querySelector('.buttonBookmark').classList.add('-active'); el.parentElement.querySelector('.buttonBookmark').innerHTML = 'Hapus dari tersimpan'; el.parentElement.setAttribute('data-saved', 'true'); } else { el.parentElement.setAttribute('data-saved', 'false'); } } }) } }) document.addEventListener("click", function(e) { // console.log(e.target) if (el.contains(e.target)) { // console.log(tdd) } else { el.parentElement.classList.remove('-active') } }); }); } } function check_bookmark(kmps_usrid, guid) { let url = ` return new Promise(function(resolve, reject) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { resolve(JSON.parse(this.responseText)) } }; xmlhttp.open("GET", url, true); xmlhttp.send(); }); } function do_bookmark(pageurl, pos, userFeedback) { const wSpecItem = document.querySelector(`.wSpec-item[data-index="${pos}"]`); const btnBookmark = wSpecItem.querySelector('.buttonBookmark'); const kmps_usrid = getCookie('kmps_usrid'); const guid = get_guid(pageurl); const type = pageurl.match(/\/watch\/(\d+)/) ? 'video' : 'article'; if (kmps_usrid) { if (btnBookmark.classList.contains('-active')) { set_unbookmark({ guid: guid, kmps_usrid: kmps_usrid, type: type }).then(function(resp) { btnBookmark.classList.remove('-active'); btnBookmark.innerHTML = 'Simpan artikel'; reactionToast('Artikel berhasil dihapus dari list yang disimpan'); userFeedback.event('un-save'); }).catch(function(resp) { // message: "Data doesn't exists" if (resp.hasOwnProperty('message') && resp.message.includes('exist')) { btnBookmark.classList.remove('-active'); btnBookmark.innerHTML = 'Simpan artikel'; reactionToast('Artikel berhasil dihapus dari list yang disimpan'); } }) } else { const user_bookmark_url = ""; set_bookmark({ guid: guid, kmps_usrid: kmps_usrid, type: type, publisher: 'kompas', platform: 'desktop' }).then(function(resp) { btnBookmark.classList.add('-active'); btnBookmark.innerHTML = 'Hapus dari tersimpan'; reactionToast('Artikel berhasil disimpan', user_bookmark_url); userFeedback.event('save'); }).catch(function(resp) { // message: "Data already exist" if (resp.hasOwnProperty('message') && resp.message.includes('exist')) { btnBookmark.classList.add('-active'); btnBookmark.innerHTML = 'Hapus dari tersimpan'; reactionToast('Artikel berhasil disimpan', user_bookmark_url); } }) } } else { const login_url = "" + btoa(window.location.href); window.location.href = login_url; } } function set_bookmark(data) { const url = ""; return new Promise(function(resolve, reject) { const xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 201) { resolve(JSON.parse(this.responseText)); } else if (this.readyState == 4 && this.status == 400) { reject(JSON.parse(this.responseText)); } }; xmlhttp.open("POST", url, true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); xmlhttp.send(formBody(data)); }); } function set_unbookmark(data) { const url = ""; return new Promise(function(resolve, reject) { const xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { resolve(JSON.parse(this.responseText)); } else if (this.readyState == 4 && this.status == 400) { reject(JSON.parse(this.responseText)); } }; xmlhttp.open("POST", url, true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); xmlhttp.send(formBody(data)); }); } class UserFeedback { constructor(engine, pageurl, jxRecHelper, pos) { this.engine = engine; this.pageurl = pageurl; this.jxRecHelper = jxRecHelper; this.pos = pos; } event(feedback) { if (this.engine == 'C') { const xmlhttp = new XMLHttpRequest(); let params = { domain: 'kompas.com', ce_userid: getCookie('kmps_usrid'), ce_sessionid: getCookie('ukid'), ce_pageurl: this.pageurl, engine: 'C', ce_feedback: feedback } xmlhttp.open("GET", ' + formatParams(params)); xmlhttp.send(); } else if (this.engine == 'V') { if (feedback == 'share') { this.jxRecHelper.shared(this.pos); } else if (feedback == 'save') { this.jxRecHelper.bookmarked(this.pos); } else if (feedback == 'not-interested') { this.jxRecHelper.hidden(this.pos); } else if (feedback == 'un-not-interested') { this.jxRecHelper.unhidden(this.pos); } } } } function formatParams(params) { return "?" + Object .keys(params) .map(function(key) { return key + "=" + encodeURIComponent(params[key]) }) .join("&") } document.addEventListener("click", function(e){ let dx = document.querySelectorAll('[data-dropdown]') if(dx) { dx.forEach(function(el){ if(el.contains(e.target)) { el.parentElement.classList.toggle('-active') } else { el.parentElement.classList.remove('-active') } }) } })