### Eclipse Workspace Patch 1.0 #P Custom Builder2 Index: infusion-builder/js/customBuild.js =================================================================== --- infusion-builder/js/customBuild.js (revision 8597) +++ infusion-builder/js/customBuild.js (working copy) @@ -10,11 +10,9 @@ */ /*global jQuery*/ -/*global fluid_1_1*/ +/*global fluid*/ -fluid_1_1 = fluid_1_1 || {}; - -(function ($, fluid) { +(function ($) { var UNSELECTED = 0; //a 'constant' value representing an unselected module @@ -190,7 +188,7 @@ idMap: that.idMap }; - fluid.selfRender(that.locate("formControls"), generatedTree(that), renderOptions); + fluid.selfRender(that.locate("compressionControls"), generatedTree(that), renderOptions); }; /** @@ -393,6 +391,11 @@ typeSelections: that.options.model.typeInfo[0].typeValue || "", moduleSelections: [] }; + + that.applier = fluid.makeChangeApplier(that.model); + that.idMap = {}; + that.moduleValues = extractArray(that.options.model.moduleInfo, "moduleValue"); + moduleNames = createModuleNamesObject(that.options.model); }; /** @@ -473,6 +476,19 @@ that.locate("moduleSelections").html(modulesSelectedString); }; + var updateHiddenFormWithSelections = function (that) { + //sets the hidden form inputs to the user selection to be posted back to the server. + that.locate("moduleSelections").val(that.model.moduleSelections); + that.locate("typeSelections").val(that.model.typeSelections); + + // Enable or disable the download button depending on how many selections have been made. + if (that.model.moduleSelections.length > 0) { + that.locate("downloadButton").removeAttr("disabled"); + } else { + that.locate("downloadButton").attr("disabled", "disabled"); + } + }; + /** * Sets up the event handlers for listeners. * @@ -480,6 +496,14 @@ */ var bindEventHandlers = function (that) { that.events.afterModuleSelectionsChanged.addListener(updateSelectedModules); + that.events.afterModelChange.addListener(updateHiddenFormWithSelections); + + setupQuickSelect(that); + + that.locate("downloadButton").click(function () { + that.locate("controls").hide(); + that.locate("downloadMessage").show(); + }); }; /** @@ -489,14 +513,8 @@ */ var setupCustomBuilder = function (that) { setupModel(that); - setupQuickSelect(that); addAria(that); - that.applier = fluid.makeChangeApplier(that.model); - that.idMap = {}; - that.moduleValues = extractArray(that.options.model.moduleInfo, "moduleValue"); - moduleNames = createModuleNamesObject(that.options.model); bindEventHandlers(that); - initSelectionCounter(that); renderModules(that); renderDownloadTypeControls(that); @@ -576,13 +594,20 @@ moduleInputLabel: ".flc-customBuild-inputLabel", moduleDescription: ".flc-customBuild-moduleDescription", - formControls: ".flc-customBuild-formControls", + compressionControls: ".flc-customBuild-compressionControls", selectionModifier: ".flc-customBuild-selectionModifier", selectionModifierInput: "#flc-customBuild-selectionModifierInput", selectionModifierLabel: ".flc-customBuild-selectionModifierLabel", checkAll: ".flc-customBuild-checkAll", - unCheckAll: ".flc-customBuild-unCheckAll" + unCheckAll: ".flc-customBuild-unCheckAll", + + controls: ".flc-customBuild-downloadControls", + downloadMessage: ".flc-customBuild-downloadMsg", + downloadButton: ".flc-customBuild-downloadButton", + + moduleSelections: "#moduleSelections", + typeSelections: "#typeSelections" }, strings: {}, @@ -594,7 +619,7 @@ afterModelChange: null, afterModuleSelectionsChanged: null }, - + // TODO: Delete me! model: { groupInfo: [ { @@ -628,4 +653,4 @@ markSelection: fluid.customBuild.updateItemAndDependencies, unmarkSelection: fluid.customBuild.updateItemAndDependencies }); -})(jQuery, fluid_1_1); +})(jQuery); Index: infusion-builder/html/CustomBuild.html =================================================================== --- infusion-builder/html/CustomBuild.html (revision 8597) +++ infusion-builder/html/CustomBuild.html (working copy) @@ -22,81 +22,86 @@ - - +
This page allows you to select which modules of the Fluid Infusion - software you would like to download. Your selections will be packaged - into a custom .zip file for downloading. Note: Some - of the modules require other modules to function, so any dependent - modules will also be automatically selected (even if you uncheck them). - If you need exact control over your build, see Creating a - Fluid Custom Build.
-This page allows you to select which modules of the Fluid Infusion + software you would like to download. Your selections will be packaged + into a custom .zip file for downloading. Note: Some + of the modules require other modules to function, so any dependent + modules will also be automatically selected (even if you uncheck them). + If you need exact control over your build, see Creating a + Fluid Custom Build.
+Thank you for your interest in the Infusion Framework.
+You might find the following links useful with your shiny new power-tools:
+ + +Thank you for your interest in the Infusion Framework.
-You might find the following links useful with your shiny new power-tools:
- - -