From 3ecc8d5918603e39b06b9a39660fc88c6e34538e Mon Sep 17 00:00:00 2001 From: Jarrett Jordaan Date: Mon, 1 Mar 2010 15:55:20 +0200 Subject: [PATCH] PT:2492070 : updated JS. --- dashboard.php | 1 + setup/wizard/resources/js/firstlogin.js | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/dashboard.php b/dashboard.php index c097420..5e62ced 100644 --- a/dashboard.php +++ b/dashboard.php @@ -147,6 +147,7 @@ class DashboardDispatcher extends KTStandardDispatcher { // function runFirstLoginWizard($oTemplate, $aTemplateData) { $this->oPage->requireJSResource('thirdpartyjs/jquery/jquery-1.3.2.min.js'); + $this->oPage->requireJSResource('thirdpartyjs/jquery/jquery_noconflict.js'); $this->oPage->requireJSResource('setup/wizard/resources/js/firstlogin.js'); } diff --git a/setup/wizard/resources/js/firstlogin.js b/setup/wizard/resources/js/firstlogin.js index bb45777..970ea25 100644 --- a/setup/wizard/resources/js/firstlogin.js +++ b/setup/wizard/resources/js/firstlogin.js @@ -1,7 +1,7 @@ var win; -$(function() { // Document is ready - if($("#wrapper").attr('class') != 'wizard') {// Check if we in a wizard, or on the dashboard +jQuery(function() { // Document is ready + if(jQuery("#wrapper").attr('class') != 'wizard') {// Check if we in a wizard, or on the dashboard showForm(); // Display first login wizard } }); @@ -16,8 +16,8 @@ function firstlogin(rootUrl, pluginHandle) { firstlogin.prototype.showFolderTemplateTree = function(templateId) { this.hideFolderTemplateTrees(); - $('#template_' + templateId).attr('style', 'display:block'); // Show template - $('#templates_' + templateId).attr('style', 'display:block'); // Show template nodes + jQuery('#template_' + templateId).attr('style', 'display:block'); // Show template + jQuery('#templates_' + templateId).attr('style', 'display:block'); // Show template nodes this.showFolderTemplateNodes(templateId); } @@ -37,14 +37,14 @@ firstlogin.prototype.showFolderTemplateNodes = function(templateId) { } firstlogin.prototype.hideFolderTemplateTrees = function() { - $('.templates').each( + jQuery('.templates').each( function() { - $(this).attr('style', 'display:none'); + jQuery(this).attr('style', 'display:none'); } ); - $('.template_nodes').each( + jQuery('.template_nodes').each( function() { - $(this).attr('style', 'display:none'); + jQuery(this).attr('style', 'display:none'); } ); } @@ -74,21 +74,21 @@ var showForm = function() { var createForm = function() { var holder = "
"; - $("#pageBody").append(holder); // Append to current dashboard + jQuery("#pageBody").append(holder); // Append to current dashboard var address = "setup/firstlogin/index.php"; getUrl(address, "firstlogin"); // Pull in existing wizard } // Send request and update a div var getUrl = function (address, div) { - $.ajax({ + jQuery.ajax({ url: address, dataType: "html", type: "POST", cache: false, success: function(data) { - $("#"+div).empty(); - $("#"+div).append(data); + jQuery("#"+div).empty(); + jQuery("#"+div).append(data); } }); } @@ -98,9 +98,9 @@ var getUrl = function (address, div) { */ var closeFirstLogin = function () { this.win.destroy(); - $('.ext-el-mask').each( // TODO : Why does overlay hang around? + jQuery('.ext-el-mask').each( // TODO : Why does overlay hang around? function() { - $(this).remove(); + jQuery(this).remove(); } ); @@ -108,14 +108,14 @@ var closeFirstLogin = function () { // Node clicked firstlogin.prototype.nodeAction = function(updateContentDiv, updateDiv, address) { - var className = $("#"+updateDiv).attr('class'); + var className = jQuery("#"+updateDiv).attr('class'); state = className.split(' '); if(state[2] == 'closed') { getUrl(address, updateContentDiv); - $("#"+updateDiv).attr('class', 'tree_icon tree_folder open'); // Replace the closed class name to open + jQuery("#"+updateDiv).attr('class', 'tree_icon tree_folder open'); // Replace the closed class name to open } else { - $("#"+updateContentDiv).empty(); // Empty out that tree. - $("#"+updateDiv).attr('class', 'tree_icon tree_folder closed'); // Replace the opened class name to close + jQuery("#"+updateContentDiv).empty(); // Empty out that tree. + jQuery("#"+updateDiv).attr('class', 'tree_icon tree_folder closed'); // Replace the opened class name to close } } @@ -124,8 +124,8 @@ firstlogin.prototype.getRootUrl = function() { } firstlogin.prototype.sendFirstLoginForm = function() { - var templateId = $("#selectedTemplate").val(); - var action = $("#step_name_templates").attr('action'); + var templateId = jQuery("#selectedTemplate").val(); + var action = jQuery("#step_name_templates").attr('action'); var address = this.rootUrl + "setup/firstlogin/" + action + "&templateId=" + templateId + "&Next=Next"; getUrl(address, 'firstlogin'); } -- libgit2 0.21.4