OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
certval
/
inc
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/20/2025 06:18:54 PM
rwxrwxrwx
📁
PHPMailer-master
-
11/12/2020 06:20:02 AM
rwxrwxr-x
📄
common.js
6 KB
12/08/2020 10:08:44 AM
rw-rw-r--
📄
jquery-3.4.1.min.js
86.08 KB
12/08/2020 10:08:44 AM
rw-rw-r--
📄
moment.min.js
52.07 KB
12/08/2020 10:08:45 AM
rw-rw-r--
📄
style.css
3.37 KB
12/08/2020 10:08:44 AM
rw-rw-r--
Editing: common.js
Close
/***************************************************** * Common Javascript functions *****************************************************/ function np() { return void(0); } function goHome() { $('.contentBox').hide(); $('#contentHome').show(); } function chkSearch() { var keyword = $('#srchKeyword').val(); var srchType = $('#srchType').val(); if (keyword == '') { alert('No keyword entered!'); return false; } if (srchType == 'title') apiSearch = 'https://deeplitresearch.in/api/v1/resources/articlesbytitle?title='; if (srchType == 'author') apiSearch = 'https://deeplitresearch.in/api/v1/resources/articlesbyauthor?author='; if (srchType == 'category') apiSearch = 'https://deeplitresearch.in/api/v1/resources/articlesbycategory?category='; $('.contentBox').hide(); $('#contentLoader').show(); $.ajax({ url: apiSearch + keyword, dataType: 'json', error: function (error) { $('#bodySearchResults').html('<div style="margin-bottom:20px">No Results found!</div>'); $('.contentBox').hide(); $('#contentSearchResults').show(); } }) .done(function(res) { processSearchResults(res); }); } function getFeaturedArticles() { $('#bodyFeaturedArticles').html($('#contentLoader').html()); $.ajax({ url: 'https://deeplitresearch.in/api/v1/resources/articles/featured', dataType: 'json' }) .done(function(res) { var htmlArticle = ''; $.each(res, function(key, value) { if (key < 3) { var itemArticle = value; if (key == 0) { htmlArticle += '<div class="boxArticle">'; } else { htmlArticle += '<div class="boxArticle" style="margin-left:30px">'; } htmlArticle += ' <a href="javascript:np()" onclick="getArticleDetails(' + itemArticle.id + ')"><img src="grfx/article0' + (key+1) + '.jpg" width="400" height="220" /></a>'; htmlArticle += ' <div class="padding15">'; htmlArticle += ' <h1><a href="javascript:np()" onclick="getArticleDetails(' + itemArticle.id + ')">' + itemArticle.title + '</a></h1>'; htmlArticle += itemArticle.first_sentence.substring(0,150) + '...'; htmlArticle += ' </div>'; htmlArticle += '</div>'; } }); $('#bodyFeaturedArticles').html(htmlArticle); }); } function getArticleDetails(wchArticle) { $('.contentBox').hide(); $('#contentLoader').show(); $.ajax({ url: 'https://deeplitresearch.in/api/v1/resources/article?id=' + wchArticle, dataType: 'json' }) .done(function(res) { if (typeof(res)) { $('#txtArticleDetail_title').html(res.title); $('#txtArticleDetail_author').html(res.author); $('#txtArticleDetail_published').html(res.year_published); $('#txtArticleDetail_doi').html(res.year_doi); $('#txtArticleDetail_summary').html(res.first_sentence); $('#txtDownloadFile').data('file', res.fileurl); $('#contentArticleDetails').show(); } else { $('.contentBox').hide(); $('#contentHome').show(); alert('No data found!'); } }); } function downloadArticle(elm) { var downloadFile = $(elm).data('file'); if (downloadFile != '') { /* fetch(downloadFile) .then(resp => resp.blob()) .then(blob => { const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; a.href = url; // the filename you want a.download = 'todo-1.json'; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); alert('your file has downloaded!'); // or you know, something with better UX... }) .catch(() => alert('oh no!')); */ window.open(downloadFile); } } function processSearchResults(res) { var htmlSearch = ''; $.each(res, function(key, value) { var itemSearch = value; htmlSearch += '<div style="margin-bottom:40px">'; htmlSearch += ' <div class="fl" style="width:30px;margin-top:5px;">' + (key+1) + '.</div>'; htmlSearch += ' <div class="fl">'; htmlSearch += ' <div class="txtMedium txtGrey">' + itemSearch.title + '</div>'; htmlSearch += ' <div style="border-bottom:2px #fdb813 solid;margin-bottom:10px;padding-bottom:20px;">'; htmlSearch += ' <div class="fl txtGrey" style="margin-right:50px"><b>Author:</b> ' + itemSearch.author + '</div>'; htmlSearch += ' <div class="fl txtGrey" style="margin-right:50px"><b>Published:</b> ' + itemSearch.year_published + '</div>'; htmlSearch += ' <div class="fl txtGrey"><b>DOI:</b> ' + itemSearch.doi + '</div>'; htmlSearch += ' <div class="cleaner"></div>'; htmlSearch += ' </div>'; htmlSearch += ' <div style="width:880px" class="fl boxAbstract">' + itemSearch.first_sentence + '</div>'; htmlSearch += ' <div class="fr" style="padding-left:20px">'; htmlSearch += ' <a href="javascript:np()" id="txtDownloadFile" data-file="' + itemSearch.fileurl + '" onclick="downloadArticle(this)" title="Download PDF"><i class="far fa-file-pdf fa-lg"></i></a>'; htmlSearch += ' </div>'; htmlSearch += ' </div>'; htmlSearch += ' <div class="cleaner"></div>'; htmlSearch += '</div>'; }); $('#bodySearchResults').html(htmlSearch); $('.contentBox').hide(); $('#contentSearchResults').show(); } function uploadArticle() { var uploadTitle = $('#uploadTitle').val(); var uploadAuthor = $('#uploadAuthor').val(); var uploadCategory = $('#uploadCategory').val(); var uploadSentence = $('#uploadSentence').val(); var uploadYear = $('#uploadYear').val(); if (uploadTitle == '') { alert('No Title entered!'); return false; } if (uploadAuthor == '') { alert('No Author entered!'); return false; } if (uploadCategory == '') { alert('No Category entered!'); return false; } if (uploadSentence == '') { alert('No First Sentence entered!'); return false; } if (uploadYear == '') { alert('No Published Year entered!'); return false; } $.ajax({ url: 'https://deeplitresearch.in/api/v1/resources/cms/upload', data: {author: uploadAuthor, title: uploadTitle, category: uploadCategory, year_published: uploadYear, first_sentence: uploadSentence} }) .done(function(res) { alert(res); }); }