Skip to content

Commit

Permalink
Merge branch 'master' into FLUID-5239
Browse files Browse the repository at this point in the history
Conflicts:
	src/tests/framework-tests/core/js/FluidIoCTests.js
  • Loading branch information
amb26 committed Feb 3, 2014
2 parents cf3cbf6 + 6218b16 commit bb2fd2f
Show file tree
Hide file tree
Showing 206 changed files with 22,773 additions and 14,069 deletions.
10 changes: 4 additions & 6 deletions ReleaseNotes.txt
Expand Up @@ -68,14 +68,12 @@ This is a list of publicly available software that is redistributed with Fluid I
categorized by license:

MIT License:
* jQuery javascript library v1.7.2 http://jquery.com/
* jQuery UI dialog, draggable, mouse, position, slider, and tabs javascript widgets v1.8.18: http://ui.jquery.com/
* jQuery UI tooltip (pre-release from jQuery UI 1.9 branch) https://github.com/jquery/jquery-ui/tree/tooltip
* jQuery QUnit: http://docs.jquery.com/QUnit
* jQuery javascript library v1.11.0 http://jquery.com/
* jQuery UI button, dialog, draggable, mouse, position, resizable, slider, tabs, and tooltip javascript widgets v1.10.4: http://ui.jquery.com/
* jQuery QUnit v1.12.0 http://qunitjs.com
* jQuery QUnit Composite v1.0.1 https://github.com/jquery/qunit-composite
* jQuery Mockjax: https://github.com/appendto/jquery-mockjax
* jQuery Chili code highlighter v2.2 http://code.google.com/p/jquery-chili-js/
* jQuery UI AriaTabs v12.07.10 https://github.com/fnagel/jQuery-Accessible-RIA/tree/master/Tabs
* jQuery bgiframe v2.1 https://github.com/brandonaaron/bgiframe
* jQuery scrollTo v1.4.2 http://flesler.blogspot.com/2007/10/jqueryscrollto.html
* jQuery Touch Punch v0.2.2 http://touchpunch.furf.com/
* Micro Clearfix http://nicolasgallagher.com/micro-clearfix-hack/
Expand Down
3 changes: 0 additions & 3 deletions build-scripts/build.properties
Expand Up @@ -48,11 +48,8 @@ module_json=lib/json
module_jQuery=lib/jquery/core
module_jQueryUICore=lib/jquery/ui
module_jQueryUIWidgets=lib/jquery/ui
module_jQueryTooltipPlugin=lib/jquery/plugins/tooltip
module_jQuerybgiframePlugin=lib/jquery/plugins/bgiframe
module_jQueryScrollToPlugin=lib/jquery/plugins/scrollTo
module_jQueryTouchPunchPlugin=lib/jquery/plugins/touchPunch
module_jQueryAriaTabsPlugin=lib/jquery/plugins/ariaTabs
module_swfupload=lib/swfupload
module_swfobject=lib/swfobject

Expand Down
2 changes: 1 addition & 1 deletion src/components/inlineEdit/inlineEditDependencies.json
Expand Up @@ -3,5 +3,5 @@
"description": "Edit text without changing context.",
"cssFiles": "InlineEdit.css",
"files": ["InlineEdit.js", "InlineEditIntegrations.js"],
"dependencies": ["jQuery", "jQueryUICore", "jQueryTooltipPlugin", "framework", "undo", "tooltip", "fss"]
"dependencies": ["jQuery", "jQueryUICore", "jQueryUIWidgets", "framework", "undo", "tooltip", "fss"]
}}
84 changes: 47 additions & 37 deletions src/components/pager/js/PagedTable.js
Expand Up @@ -26,16 +26,13 @@ var fluid_1_5 = fluid_1_5 || {};
// cf. ancient SVN-era version in bitbucket at https://bitbucket.org/fluid/infusion/src/adf319d9b279/branches/FLUID-2881/src/webapp/components/pager/js/PagedTable.js

fluid.defaults("fluid.pagedTable.rangeAnnotator", {
gradeNames: ["fluid.eventedComponent", "autoInit"],
listeners: {
"{pagedTable}.events.onRenderPageLinks": {
funcName: "fluid.pagedTable.rangeAnnotator.onRenderPageLinks",
args: ["{pagedTable}", "{arguments}.0", "{arguments}.1"]
}
}
gradeNames: ["fluid.eventedComponent", "autoInit"]
});

fluid.pagedTable.rangeAnnotator.onRenderPageLinks = function (that, tree, newModel) {
// TODO: Get rid of this old-style kind of architecture - we should just react to model changes directly and not inject this
// peculiar event up and down the place. Probably best to have new renderer first.
fluid.pagedTable.rangeAnnotator.onRenderPageLinks = function (that, tree, newModel, pagerBar) {
pagerBar.tooltip.close(); // Close any existing tooltips otherwise they will linger after their parent is destroyed
var roots = {};
var column = that.options.annotateColumnRange || (that.options.annotateSortedColumn ? newModel.sortKey : null);
if (!column) {
Expand All @@ -51,39 +48,24 @@ var fluid_1_5 = fluid_1_5 || {};
}
var tModel = {};
fluid.model.copyModel(tModel, newModel);
var tooltipInfo = {};

fluid.transform(tree, function (cell) {
if (cell.ID === "page-link:link") {
fluid.each(tree, function (cell) {
if (cell.ID === "page-link:link" && !cell.current) {
var page = cell.pageIndex;
var start = page * tModel.pageSize;
tModel.pageIndex = page;
var limit = fluid.pager.computePageLimit(tModel);
var iValue = fetchValue(start);
var lValue = fetchValue(limit - 1);

var tooltipOpts = fluid.copy(that.options.tooltip.options) || {};

if (!tooltipOpts.content) {
tooltipOpts.content = function () {
return fluid.stringTemplate(that.options.markup.rangeAnnotation, {
first: iValue,
last: lValue
});
};
}

if (!cell.current) {
var decorators = [
{
type: "fluid",
func: that.options.tooltip.type,
options: tooltipOpts
}
];
cell.decorators = cell.decorators.concat(decorators);
}

tooltipInfo[page] = {
first: iValue,
last: lValue
};
}
});
pagerBar.tooltipInfo = tooltipInfo;
};


Expand All @@ -96,19 +78,47 @@ var fluid_1_5 = fluid_1_5 || {};
}
return togo;
};

fluid.pagedTable.configureTooltip = function (pagedTable, pagerBar, renderedPageList) {
var idMap = renderedPageList.rendererOptions.idMap;
var idToContent = {};
fluid.each(pagerBar.tooltipInfo, function (value, index) {
idToContent[idMap["pageLink:"+index]] = fluid.stringTemplate(pagedTable.options.markup.rangeAnnotation, value);
});
pagerBar.tooltip.applier.requestChange("idToContent", idToContent);
};

fluid.defaults("fluid.pagedTable", {
gradeNames: ["fluid.pager", "fluid.table", "autoInit"],
components: {
rangeAnnotator: {
type: "fluid.pagedTable.rangeAnnotator"
distributeOptions: [{
target: "{that renderedPageList}.options.listeners.afterRender",
record: {
funcName: "fluid.pagedTable.configureTooltip",
args: ["{pagedTable}", "{pagerBar}", "{arguments}.0"]
// NB! Use of "pagerBar" depends on FLUID-5258 - we will need a new annotation when this is fixed
}
},
}, {
target: "{that renderedPageList}.options.listeners.onRenderPageLinks",
record: {
funcName: "fluid.pagedTable.rangeAnnotator.onRenderPageLinks",
args: ["{pagedTable}", "{arguments}.0", "{arguments}.1", "{pagerBar}"] // FLUID-5258 as above
}
}, {
target: "{that pagerBar}.options.components.tooltip",
source: "{that}.options.tooltip"
}],
annotateSortedColumn: false,
annotateColumnRange: undefined, // specify a "key" from the columnDefs

markup: {
rangeAnnotation: "<b> %first </b><br/>&mdash;<br/><b> %last </b>"
},

tooltip: {
type: "fluid.tooltip"
type: "fluid.tooltip",
container: "{that}.container",
options: {
}
},
invokers: {
acquireDefaultRange: {
Expand Down
7 changes: 2 additions & 5 deletions src/components/pager/js/Pager.js
Expand Up @@ -160,7 +160,7 @@ var fluid_1_5 = fluid_1_5 || {};
localID: page + 1,
value: page + 1,
pageIndex: page,
decorators: [
decorators: [{ identify: "pageLink:" + page},
{
type: "jQuery",
func: "click",
Expand Down Expand Up @@ -221,6 +221,7 @@ var fluid_1_5 = fluid_1_5 || {};
fluid.defaults("fluid.pager.renderedPageList", {
gradeNames: ["fluid.rendererComponent", "fluid.pager.pageList", "autoInit"],
rendererOptions: {
idMap: {},
cutpoints: [
{
id: "page-link:link",
Expand Down Expand Up @@ -579,10 +580,6 @@ var fluid_1_5 = fluid_1_5 || {};

strings: {
last: " (last)"
},

markup: {
rangeAnnotation: "<b> %first </b><br/>&mdash;<br/><b> %last </b>"
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/pager/pagerDependencies.json
Expand Up @@ -3,5 +3,5 @@
"description": "Sort and organize large amounts of data.",
"cssFiles": "Pager.css",
"files": ["Pager.js", "Table.js", "PagedTable.js"],
"dependencies": ["jQuery", "jQueryTooltipPlugin", "jQuerybgiframePlugin", "framework", "renderer", "tooltip"]
"dependencies": ["jQuery", "jQueryUIWidgets", "framework", "renderer", "tooltip"]
}}
12 changes: 8 additions & 4 deletions src/components/reorderer/js/Reorderer.js
Expand Up @@ -189,7 +189,8 @@ var fluid_1_5 = fluid_1_5 || {};
},
avatarCreator: fluid.reorderer.defaultAvatarCreator,
keysets: fluid.reorderer.defaultKeysets,
containerRole: "{that}.layoutHandler.options.containerRole", // These two ginger options injected "upwards" from layoutHandler
// These two ginger options injected "upwards" from layoutHandler and actually time its construction (before FLUID-4925)
containerRole: "{that}.layoutHandler.options.containerRole",
selectablesTabindex: "{that}.layoutHandler.options.selectablesTabindex",
layoutHandler: "fluid.listLayoutHandler",

Expand Down Expand Up @@ -431,7 +432,7 @@ var fluid_1_5 = fluid_1_5 || {};
// unsupported, NON-API function
fluid.reorderer.requestMovement = function (thatReorderer, requestedPosition, item) {
item = fluid.unwrap(item);
// Temporary censoring to get around ModuleLayout inability to update relative to self.
// Temporary censoring to get around ModuleLayout inability to update relative to self.
if (!requestedPosition || fluid.unwrap(requestedPosition.element) === item) {
return;
}
Expand Down Expand Up @@ -575,8 +576,9 @@ var fluid_1_5 = fluid_1_5 || {};
}
);
var avatar;
var handle = thatReorderer.dom.fastLocate("grabHandle", item);

thatReorderer.dom.fastLocate("grabHandle", item).draggable({
item.draggable({
refreshPositions: false,
scroll: true,
helper: function () {
Expand Down Expand Up @@ -624,7 +626,9 @@ var fluid_1_5 = fluid_1_5 || {};
// refocus on the active item because moving places focus on the body
thatReorderer.activeItem.focus();
},
handle: thatReorderer.dom.fastLocate("grabHandle", item)
// This explicit detection is now required for jQuery UI after version 1.10.2 since the upstream API has been broken permanently.
// See https://github.com/jquery/jquery-ui/pull/963
handle: handle === item ? null : handle
});
};

Expand Down
19 changes: 13 additions & 6 deletions src/components/tabs/js/Tabs.js
Expand Up @@ -13,7 +13,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
// Declare dependencies
/*global fluid_1_5:true, jQuery*/

// JSLint options
// JSLint options
/*jslint white: true, funcinvoke: true, undef: true, newcap: true, nomen: true, regexp: true, bitwise: true, browser: true, forin: true, maxerr: 100, indent: 4 */

var fluid_1_5 = fluid_1_5 || {};
Expand All @@ -22,20 +22,27 @@ var fluid_1_5 = fluid_1_5 || {};
/**********************
* Tabs *
*********************/

fluid.defaults("fluid.tabs", {
gradeNames: ["fluid.viewComponent", "autoInit"],
tabOptions: {},
events: {
events: {
// These events are forwarded out of the jQueryUI Tabs' equivalents
// with signature (that, event, ui)
tabsselect: "preventable",
tabsload: null,
tabsshow: null
tabsshow: null
},
listeners: {
"onCreate.initTabs": {
"this": "{that}.container",
"method": "tabs",
"args": "{that}.options.tabOptions"
}
},
finalInitFunction: "fluid.tabs.finalInit"
});
});

fluid.tabs.finalInit = function (that) {
that.container.tabs(that.options.tabOptions); //jQuery UI Tabs
fluid.each(that.options.events, function(value, eventName) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/tabsDependencies.json
Expand Up @@ -2,5 +2,5 @@
"name": "Tabs",
"description": "A wrapper for jquery ui tabs",
"files": ["Tabs.js"],
"dependencies": ["jQuery", "jQueryUICore", "jQueryAriaTabsPlugin", "framework"]
"dependencies": ["jQuery", "jQueryUICore", "jQueryUIWidgets", "framework"]
}}

0 comments on commit bb2fd2f

Please sign in to comment.