One Hat Cyber Team
Your IP :
216.73.216.182
Server IP :
203.175.9.166
Server :
Linux tanggamus.iixcp.rumahweb.net 5.14.0-427.28.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 2 03:44:10 EDT 2024 x86_64
Server Software :
LiteSpeed
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
cite5577
/
www
/
lib
/
pkp
/
js
/
lib
/
jquery
/
plugins
/
View File Name :
jquery.pkp.js
/** * @defgroup js_lib_jquery_plugins */ /** * @file js/lib/jquery/plugins/jquery.pkp.js * * Copyright (c) 2014-2021 Simon Fraser University * Copyright (c) 2000-2021 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @ingroup js_lib_jquery_plugins * * @brief PKP jQuery extensions. */ (function($) { /** * Handler plug-in. * @this {jQuery} * @param {string} handlerName The handler to be instantiated * and attached to the target HTML element(s). * @param {Object=} options Parameters to be passed on * to the handler. * @return {jQueryObject} Selected HTML elements for chaining. */ $.fn.pkpHandler = function(handlerName, options) { // Go through all selected elements. this.each(function() { var $element = $(this); // Instantiate the handler and bind it // to the element. options = options || {}; var handler = $.pkp.classes.Helper.objectFactory( handlerName, [$element, options]); }); // Allow chaining. return this; }; /** * Re-implementation of jQuery's html() method * with a remote source. * @param {string} url the AJAX endpoint from which to * retrieve the HTML to be inserted. * @param {Object=} callback function to be called on ajax success. * @return {jQueryObject} Selected HTML elements for chaining. */ $.fn.pkpAjaxHtml = function(url, callback) { var $element = this.first(); // using $.ajax instead of .getJSON to handle failures. // .getJSON does not allow for an error callback // this changes with jQuery 1.5 $.ajax({ url: url, dataType: 'json', success: function(jsonData) { $element.find('#loading').hide(); if (jsonData.status === true) { // Replace the element content with // the remote content. if (jsonData.content) { $element.html(jsonData.content); } if (callback) { callback(); } } else { // Alert that the remote call failed. $element.trigger('ajaxHtmlError', jsonData.content); alert(jsonData.content); } }, error: function() { alert('Failed Ajax request or invalid JSON returned.'); } }); $element.html("<div id='loading' class='throbber'></div>"); return this; }; })(jQuery);