diff --git a/core/modules/rlayout/config/grid.six_column_fluid_tablet.yml b/core/modules/rlayout/config/grid.six_column_fluid_tablet.yml new file mode 100644 index 0000000..744496e --- /dev/null +++ b/core/modules/rlayout/config/grid.six_column_fluid_tablet.yml @@ -0,0 +1,12 @@ +id: six_column_fluid_tablet +label: Six column fluid +type: equal_column +options: + type: 'fluid' + width: 100 + columns: 6 + padding_width: 1.5 + gutter_width: 2 + breakpoints: + - 'module.rlayout.tablet' + diff --git a/core/modules/rlayout/config/grid.three_column_fluid_smartphone.yml b/core/modules/rlayout/config/grid.three_column_fluid_smartphone.yml new file mode 100644 index 0000000..a5077bf --- /dev/null +++ b/core/modules/rlayout/config/grid.three_column_fluid_smartphone.yml @@ -0,0 +1,12 @@ +id: three_column_fluid_smartphone +label: Three column fluid +type: equal_column +options: + type: 'fluid' + width: 100 + columns: 3 + padding_width: 1.5 + gutter_width: 2 + breakpoints: + - 'module.rlayout.smartphone' + diff --git a/core/modules/rlayout/config/grid.twelve_column_fluid_standard.yml b/core/modules/rlayout/config/grid.twelve_column_fluid_standard.yml new file mode 100644 index 0000000..ef98884 --- /dev/null +++ b/core/modules/rlayout/config/grid.twelve_column_fluid_standard.yml @@ -0,0 +1,12 @@ +id: twelve_column_fluid_standard +label: Twelve column fluid +type: equal_column +options: + type: 'fluid' + width: 100 + columns: 12 + padding_width: 1.5 + gutter_width: 2 + breakpoints: + - 'module.rlayout.standard' + diff --git a/core/modules/rlayout/config/rlayout.breakpoints.yml b/core/modules/rlayout/config/rlayout.breakpoints.yml new file mode 100644 index 0000000..d8f354c --- /dev/null +++ b/core/modules/rlayout/config/rlayout.breakpoints.yml @@ -0,0 +1,3 @@ +smartphone: '(min-width: 0px)' +tablet: 'all and (min-width: 321px) and (max-width: 760px)' +standard: 'all and (min-width: 761px)' diff --git a/core/modules/rlayout/config/rlayoutset.default.yml b/core/modules/rlayout/config/rlayoutset.default.yml new file mode 100644 index 0000000..292e361 --- /dev/null +++ b/core/modules/rlayout/config/rlayoutset.default.yml @@ -0,0 +1,19 @@ +id: default +label: Default layout +regions: + - header_a + - header_b + - header_c + - subheader_a + - subheader_b + - subheader_c + - navigation + - title + - body + - sidebar_a + - sidebar_b + - sidebar_c + - footer_a + - footer_b + - footer_c +overrides: diff --git a/core/modules/rlayout/designer/app/libs/Grid/Grid.js b/core/modules/rlayout/designer/app/libs/Grid/Grid.js new file mode 100644 index 0000000..ff7b42a --- /dev/null +++ b/core/modules/rlayout/designer/app/libs/Grid/Grid.js @@ -0,0 +1,25 @@ +(function (RLD, $) { + + RLD['Grid'] = (function () { + + var plugin = 'Grid'; + + function Grid() { + // Initialize the object. + this.init.apply(this, arguments); + } + /** + * Extend the InitClass Object. + */ + Grid.prototype = new RLD.InitClass(); + /** + * + */ + Grid.prototype.setup = function () { + + }; + + return Grid; + + }()); +}(ResponsiveLayoutDesigner, jQuery)); \ No newline at end of file diff --git a/core/modules/rlayout/designer/app/libs/GridList/GridList.js b/core/modules/rlayout/designer/app/libs/GridList/GridList.js new file mode 100644 index 0000000..2f039d8 --- /dev/null +++ b/core/modules/rlayout/designer/app/libs/GridList/GridList.js @@ -0,0 +1,58 @@ +(function (RLD, $) { + // Temp location. + RLD['GridList'] = (function () { + + var plugin = 'GridList'; + + function GridList() { + this.items = []; + // Initialize the object. + this.init.apply(this, arguments); + } + /** + * Extend the InitClass Object. + */ + GridList.prototype = new RLD.InitClass(); + /** + * + */ + GridList.prototype.setup = function () { + // Process list items. + if ('grids' in this) { + this.processList(this.grids); + delete this.grids; + } + else { + this.log('[RLD | ' + plugin + '] The list has no items at setup.'); + } + }; + /** + * + */ + GridList.prototype.build = function () { + return this.$editor; + }; + /** + * + */ + GridList.prototype.processList = function (items) { + var i; + for (i = 0; i < items.length; i++) { + this.items.push(new RLD.Grid({ + 'machine_name': items[i].machine_name, + 'columns': items[i].columns, + 'classes': items[i].classes + })); + } + }; + /** + * + */ + GridList.prototype.update = function (type, list) { + this.items = type; + }; + + return GridList; + + }()); +}(ResponsiveLayoutDesigner, jQuery)); diff --git a/core/modules/rlayout/designer/app/libs/LayoutList/LayoutList.js b/core/modules/rlayout/designer/app/libs/LayoutList/LayoutList.js new file mode 100644 index 0000000..fa81b04 --- /dev/null +++ b/core/modules/rlayout/designer/app/libs/LayoutList/LayoutList.js @@ -0,0 +1,72 @@ +(function (RLD, $) { + // Temp location. + RLD['LayoutList'] = (function () { + + var plugin = 'LayoutList'; + + function LayoutList() { + this.items = []; + // Initialize the object. + this.init.apply(this, arguments); + } + /** + * Extend the InitClass Object. + */ + LayoutList.prototype = new RLD.InitClass(); + /** + * + */ + LayoutList.prototype.setup = function () { + // Process list items. + if ('layouts' in this) { + this.processList(this.layouts); + delete this.layouts; + } + else { + this.log('[RLD | ' + plugin + '] The list has no items at setup.'); + } + }; + /** + * + */ + LayoutList.prototype.processList = function (items) { + // The broadcaster just pipes events through. + var handlers = {}; + var newSet = []; + var i, layoutStep, listener, fn; + // Create obects for each composite. + for (i = 0; i < items.length; i++) { + // Save the layout elements into a unit. + layoutStep = new RLD.LayoutStep({ + 'regionList': items[i].regionList, + 'step': items[i].step, + 'grid': items[i].grid + }); + // Pust the layoutStep into the list. + this.items.push(layoutStep); + newSet.push(layoutStep); + + } + // Register pass-through topics. + this.transferSubscriptions(this.items); + // Return the items that were added. + return newSet; + }; + /** + * + */ + LayoutList.prototype.addItem = function (layout) { + var items = this.processList([layout]); + return items; + } + /** + * + */ + LayoutList.prototype.update = function (type, list) { + this.items = list; + }; + + return LayoutList; + + }()); +}(ResponsiveLayoutDesigner, jQuery)); diff --git a/core/modules/rlayout/designer/app/libs/LayoutManager/LayoutManager.js b/core/modules/rlayout/designer/app/libs/LayoutManager/LayoutManager.js new file mode 100644 index 0000000..b7e3456 --- /dev/null +++ b/core/modules/rlayout/designer/app/libs/LayoutManager/LayoutManager.js @@ -0,0 +1,426 @@ +(function (RLD, $) { + /** + * LayoutManager editor provides functionality to display, add and remove + * layout representations across arbitrary, user-defined breakpoint limits. + */ + RLD['LayoutManager'] = (function build() { + + var plugin = 'LayoutManager'; + + function LayoutManager() { + // Ui components. + this.options = { + 'ui': { + 'class-layout': 'rld-stepmanager', + 'class-layout-tabs': 'rld-steps', + 'class-layout-content': 'rld-layouts' + } + }; + this.$editor = $(); + this.$stepSelector = $(); + this.$steps = $(); + this.$layouts = $(); + this.activeLayoutStep; + // Setup + this.init.apply(this, arguments); + } + /** + * Extend the InitClass Object. + */ + LayoutManager.prototype = new RLD.InitClass(); + /** + * Integrate instantiation options. + */ + LayoutManager.prototype.setup = function () { + var fn, steps; + // Instantiate classes. + this.stepManager = new RLD.StepManager(); + this.layoutList = new RLD.LayoutList(); + // Define topics that will pass-through. + this.topic('regionOrderUpdated'); + this.topic('layoutSaved'); + this.topic('regionResized'); + this.topic('regionResizing'); + this.topic('regionResizeStarted'); + // Transfer pass-through subscriptions. + this.transferSubscriptions([ + this.stepManager, + this.regionList, + this.layoutList + ]); + // Register for events on the stepManager. + fn = $.proxy(this.switchStep, this); + this.stepManager.topic('stepActivated').subscribe(fn); + // Register for events on the regionList. + fn = $.proxy(this.insertRegion, this); + this.regionList.topic('regionAdded').subscribe(fn); + fn = $.proxy(this.removeRegion, this); + this.regionList.topic('regionRemoved').subscribe(fn); + // Register for events on the layoutList + fn = $.proxy(this.requestRegionRemove, this); + this.layoutList.topic('regionRemoved').subscribe(fn); + // Assemble the editor managers and containers. + this.$stepSelector = $('
', { + 'class': this.ui['class-layout'] + }); + this.$steps = $('