diff --git a/index.html b/index.html index 63575124..be1f29a0 100644 --- a/index.html +++ b/index.html @@ -25,6 +25,7 @@ + @@ -35,7 +36,6 @@ - diff --git a/src/assets/groups.json b/src/assets/groups.json index bb05bd01..b8c6ed6e 100644 --- a/src/assets/groups.json +++ b/src/assets/groups.json @@ -21,10 +21,27 @@ "Boolean": ["#0._hidden_node.jqm_input_boolean"] } ], - "List Views": [ - "List", "OrderedList", "ListItem", "ListDivider", "ListButton" - ], - "Image": ["Image"] + "Image": ["Image"], + "List Views": [ { + "Single Lists": [ + "SimpleListItem", + "ListDivider", + "SimpleList", + "ButtonList", + "TextList", + "IconList", + "ThumbnailList" + ], + "Split Lists": [ + "SimpleListItem", + "ListDivider", + "ButtonSplitList", + "TextSplitList", + "IconSplitList", + "ThumbnailSplitList" + ] + } + ] } ], diff --git a/src/css/builder.css b/src/css/builder.css index 6ee74f20..a01c0329 100644 --- a/src/css/builder.css +++ b/src/css/builder.css @@ -340,7 +340,7 @@ body.ui-tabs.ui-widget { position: relative; display: inline-block; zoom: 1; - width: 102px; + width: 115px; z-index: 999; } .view.live .deviceSelect > a { @@ -418,6 +418,10 @@ body.ui-tabs.ui-widget { left: 120px; top: 0px; } +#deviceSelectMenu li ul li { + overflow: hidden; + text-overflow: ellipsis +} .view.live .deviceSelect .arrow b { display: block; } @@ -929,7 +933,7 @@ div.propertyItems > div > * { display: table-cell; padding-bottom: 8px; } -table#selectOption { +table.selectTable { width: 100%; } div.propertyItems label[for] { diff --git a/src/css/composer.css b/src/css/composer.css index 5663474c..40b1d136 100644 --- a/src/css/composer.css +++ b/src/css/composer.css @@ -48,7 +48,7 @@ /*************************/ /* Class specific tweaks */ /*************************/ -.nrc-sortable-container.ui-content .adm-node { +.nrc-sortable-container.ui-content > * { margin-top: 10px; margin-bottom: 10px; } diff --git a/src/css/images/widgets/jqm_button_list.svg b/src/css/images/widgets/jqm_button_list.svg new file mode 100644 index 00000000..647be337 --- /dev/null +++ b/src/css/images/widgets/jqm_button_list.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +Button List + + + + + + + + + diff --git a/src/css/images/widgets/jqm_button_split_list.svg b/src/css/images/widgets/jqm_button_split_list.svg new file mode 100644 index 00000000..edd6c5ce Binary files /dev/null and b/src/css/images/widgets/jqm_button_split_list.svg differ diff --git a/src/css/images/widgets/jqm_icon_list.svg b/src/css/images/widgets/jqm_icon_list.svg new file mode 100644 index 00000000..af655fe4 Binary files /dev/null and b/src/css/images/widgets/jqm_icon_list.svg differ diff --git a/src/css/images/widgets/jqm_icon_list_button.svg b/src/css/images/widgets/jqm_icon_list_button.svg new file mode 100644 index 00000000..53c6e1f2 --- /dev/null +++ b/src/css/images/widgets/jqm_icon_list_button.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + +Icon List Button + + + diff --git a/src/css/images/widgets/jqm_icon_split_list.svg b/src/css/images/widgets/jqm_icon_split_list.svg new file mode 100644 index 00000000..7293b6df Binary files /dev/null and b/src/css/images/widgets/jqm_icon_split_list.svg differ diff --git a/src/css/images/widgets/jqm_list.svg b/src/css/images/widgets/jqm_list.svg index ff9dd70b..4481b865 100644 --- a/src/css/images/widgets/jqm_list.svg +++ b/src/css/images/widgets/jqm_list.svg @@ -32,7 +32,7 @@ -Unordered List +Simple List diff --git a/src/css/images/widgets/jqm_list_split_button.svg b/src/css/images/widgets/jqm_list_split_button.svg deleted file mode 100644 index 2411051f..00000000 --- a/src/css/images/widgets/jqm_list_split_button.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - -List Split Button - - - - diff --git a/src/css/images/widgets/jqm_text_list.svg b/src/css/images/widgets/jqm_text_list.svg new file mode 100644 index 00000000..a093acef --- /dev/null +++ b/src/css/images/widgets/jqm_text_list.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +Text List + + + + + + + + + diff --git a/src/css/images/widgets/jqm_text_list_button.svg b/src/css/images/widgets/jqm_text_list_button.svg new file mode 100644 index 00000000..7bee4b5c Binary files /dev/null and b/src/css/images/widgets/jqm_text_list_button.svg differ diff --git a/src/css/images/widgets/jqm_text_split_list.svg b/src/css/images/widgets/jqm_text_split_list.svg new file mode 100644 index 00000000..f9faa178 Binary files /dev/null and b/src/css/images/widgets/jqm_text_split_list.svg differ diff --git a/src/css/images/widgets/jqm_thumbnail_list.svg b/src/css/images/widgets/jqm_thumbnail_list.svg new file mode 100644 index 00000000..a1da7b67 Binary files /dev/null and b/src/css/images/widgets/jqm_thumbnail_list.svg differ diff --git a/src/css/images/widgets/jqm_thumbnail_list_button.svg b/src/css/images/widgets/jqm_thumbnail_list_button.svg new file mode 100644 index 00000000..2dfb18aa --- /dev/null +++ b/src/css/images/widgets/jqm_thumbnail_list_button.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + +Thumbnail List Button + + + diff --git a/src/css/images/widgets/jqm_thumbnail_split_list.svg b/src/css/images/widgets/jqm_thumbnail_split_list.svg new file mode 100644 index 00000000..309ee419 Binary files /dev/null and b/src/css/images/widgets/jqm_thumbnail_split_list.svg differ diff --git a/src/js/adm.js b/src/js/adm.js index 99b1f1bf..cf0c6f11 100644 --- a/src/js/adm.js +++ b/src/js/adm.js @@ -359,7 +359,7 @@ ADM.endTransaction = function () { * @return {ADMNode} The child object, on success; null, on failure. */ ADM.addChild = function (parentRef, childRef, dryrun) { - var parent, child; + var parent, child, oldParent, oldType, oldZone, oldZoneIndex; parent = ADM.toNode(parentRef); if (!parent) { @@ -379,6 +379,12 @@ ADM.addChild = function (parentRef, childRef, dryrun) { return null; } + oldParent = child.getParent(); + if (oldParent) { + oldType = child.getType(); + oldZone = child.getZone(); + oldZoneIndex = child.getZoneIndex(); + } if (parent.addChild(child, dryrun)) { if (dryrun) { return true; @@ -388,7 +394,11 @@ ADM.addChild = function (parentRef, childRef, dryrun) { ADM.transaction({ type: "add", parent: child.getParent(), - child: child + child: child, + oldParent: oldParent, + oldType: oldType, + oldZone: oldZone, + oldZoneIndex: oldZoneIndex }); return child; } @@ -475,7 +485,7 @@ ADM.addChildRecursive = function (parentRef, childRef, dryrun) { * @private */ ADM.insertChildRelative = function (siblingRef, childRef, offset, dryrun) { - var sibling, child; + var sibling, child, oldParent, oldType, oldZone, oldZoneIndex; sibling = ADM.toNode(siblingRef); if (!sibling) { @@ -496,6 +506,12 @@ ADM.insertChildRelative = function (siblingRef, childRef, offset, dryrun) { childRef); } + oldParent = child.getParent(); + if (oldParent) { + oldType = child.getType(); + oldZone = child.getZone(); + oldZoneIndex = child.getZoneIndex(); + } if (sibling.insertChildRelative(child, offset, dryrun)) { if (dryrun) { return true; @@ -504,7 +520,11 @@ ADM.insertChildRelative = function (siblingRef, childRef, offset, dryrun) { type: "insertRelative", sibling: sibling, child: child, - offset: offset + offset: offset, + oldParent: oldParent, + oldType: oldType, + oldZone: oldZone, + oldZoneIndex: oldZoneIndex }); return child; } @@ -760,21 +780,21 @@ ADM.transaction = function (obj) { */ ADM.undo = function () { var obj, undo = function (obj) { - if (obj.type === "add") { + if ( ["add", "insertRelative", "move"].indexOf(obj.type) !== -1) { ADM.ensurePageInactive(obj.child); - obj.parent.removeChild(obj.child); + if (obj.oldParent) { + if (obj.oldType !== obj.child.getType()) + obj.child.morphTo(obj.oldType); + obj.child.moveNode(obj.oldParent, obj.oldZone, obj.oldZoneIndex); + ADM.setSelected(obj.child); + } + else + obj.child.getParent().removeChild(obj.child); } else if (obj.type === "remove") { obj.parent.insertChildInZone(obj.child, obj.zone, obj.zoneIndex); ADM.setSelected(obj.child); } - else if (obj.type === "move") { - obj.node.moveNode(obj.oldParent, obj.oldZone, obj.oldZoneIndex); - ADM.setSelected(obj.node); - } - else if (obj.type === "insertRelative") { - obj.sibling.getParent().removeChild(obj.child); - } else if (obj.type === "propertyChange") { // TODO: this could require deeper copy of complex properties obj.node.setProperty(obj.property, obj.oldValue, obj.data); @@ -1008,18 +1028,8 @@ function ADMNode(widgetType) { var currentType = widgetType, widget, zones, length, i, func; this._valid = false; - this._inheritance = []; - - while (currentType) { - widget = BWidgetRegistry[currentType]; - if (typeof widget === "object") { - this._inheritance.push(currentType); - currentType = widget.parent; - } else { - console.error("Error: invalid type hierarchy creating ADM node"); - return; - } - } + this._inheritance = [widgetType]; + $.merge(this._inheritance, BWidget.getAncestors(widgetType)); this._uid = ++ADMNode.prototype._lastUid; @@ -1452,6 +1462,18 @@ ADMNode.prototype.hasUserVisibleDescendants = function () { return false; }; +/** + * Change this node to another type + * + * @param {String} type The type this node will morph to. + * @return {ADMNode} The morphed node. + */ +ADMNode.prototype.morphTo = function (type) { + var morphedChild = ADM.createNode(type); + this._inheritance = morphedChild._inheritance; + this._zones = morphedChild._zones; + return this; +}; /** * Adds given child object to this object, generally at the end of the first * zone that accepts the child. @@ -1519,11 +1541,19 @@ ADMNode.prototype.addChild = function (child, dryrun) { ADMNode.prototype.addChildToZone = function (child, zoneName, zoneIndex, dryrun) { // requires: assumes cardinality is "N", or a numeric string - var add = false, myType, childType, zone, cardinality, limit; + var add = false, myType, childType, zone, cardinality, limit, morph, + morphedChildType, morphedChild; myType = this.getType(); childType = child.getType(); zone = this._zones[zoneName]; + morph = BWidget.getZone(myType, zoneName).morph; + if (morph) { + morphedChildType = morph(childType, myType); + if (morphedChildType !== childType) { + childType = morphedChildType; + } + } if (!BWidget.zoneAllowsChild(myType, zoneName, childType)) { if (!dryrun) { console.warn("Warning: zone " + zoneName + @@ -1546,6 +1576,7 @@ ADMNode.prototype.addChildToZone = function (child, zoneName, zoneIndex, return false; } + cardinality = cardinality.max || cardinality; if (cardinality !== "N") { limit = parseInt(cardinality, 10); if (zone.length >= limit) { @@ -1630,7 +1661,8 @@ ADMNode.prototype.insertChildInZone = function (child, zoneName, index, } } - var zone = this._zones[zoneName]; + var zone = this._zones[zoneName], oldParent, + myType, childType, morph, morphedChildType; if (!zone) { console.error("Error: zone not found in insertChildInZone: " + zoneName); @@ -1641,7 +1673,22 @@ ADMNode.prototype.insertChildInZone = function (child, zoneName, index, return false; } if (child instanceof ADMNode) { + oldParent = child.getParent(); + if (oldParent) { + if (oldParent === this && child.getZone() === zoneName + && child.getZoneIndex() < index) + index --; + return child.moveNode(this, zoneName, index, dryrun); + } if (!dryrun) { + myType = this.getType(); + childType = child.getType(); + morph = BWidget.getZone(myType, zoneName).morph; + if (morph) { + morphedChildType = morph(childType, myType); + if (morphedChildType != childType) + child.morphTo(morphedChildType); + } zone.splice(index, 0, child); setRootRecursive(child, this._root); @@ -1757,12 +1804,30 @@ ADMNode.prototype.removeChild = function (child, dryrun) { * @return {ADMNode} The removed child, or null if not found. */ ADMNode.prototype.removeChildFromZone = function (zoneName, index, dryrun) { - var zone, removed, child, parentNode, parent; + var zone, removed, child, parent, cardinality, min; zone = this._zones[zoneName]; if (!zone) { console.error("Error: no such zone found while removing child: " + zoneName); } + cardinality = BWidget.getZoneCardinality(this.getType(), zoneName); + if (!cardinality) { + console.warn("Warning: no cardinality found for zone " + zoneName); + return false; + } + + if (cardinality.min) { + min = parseInt(cardinality.min, 10); + + if (zone.length <= min) { + alert("At least " + + cardinality.min + " " + + BWidget.getDisplayLabel(zone[index].getType()) + + (min === 1 ? " " : "s ") + + (min === 1 ? "is": "are") + " required and cannot be deleted!"); + return false; + } + } if (dryrun) { removed = [zone[index]]; diff --git a/src/js/composer.js b/src/js/composer.js index 36618177..8fded684 100644 --- a/src/js/composer.js +++ b/src/js/composer.js @@ -279,58 +279,6 @@ $(function() { } }; - var addNewNodeOnDrop = function (domParent, domChildren, adm, pid, - nodeRef, role, domNode) { - var newNode, domSibling, sid, admChildren, domIndex, debug; - - debug = (window.top.$.rib && window.top.$.rib.debug()); - domIndex = domChildren.index(domNode); - - // Append first(only)/last child to this container - if (domIndex >= domChildren.length-1 || role === 'page') { - if (adm.addChild(pid, nodeRef, true)) { - newNode = adm.addChild(pid, nodeRef); - debug && console.log('Appended node',role); - newNode && adm.setSelected(newNode); - } else { - console.warn('Append child failed:',role); - } - } else if (domIndex > 0) { - // Insert nth child into this container - domSibling = $(domNode, domParent).prev('.adm-node'); - sid = domSibling.attr('data-uid'); - if (adm.insertChildAfter(sid, nodeRef, true)) { - newNode = adm.insertChildAfter(sid, nodeRef); - debug && console.log('Inserted nth node',role); - newNode && adm.setSelected(newNode); - } else { - console.warn('Insert nth child failed:',role); - } - } else { - // Add 1st child into an empty container - if (domChildren.length-1 <= 0) { - if (adm.addChild(pid, nodeRef, true)) { - newNode = adm.addChild(pid, nodeRef); - debug && console.log('Added 1st node',role); - newNode && adm.setSelected(newNode); - } else { - console.warn('Add 1st child failed:',role); - } - } else { - // Insert 1st child into non-empty container - admChildren = adm.toNode(pid).getChildren(); - sid = admChildren.length && admChildren[0].getUid(); - if (adm.insertChildBefore(sid, nodeRef, true)) { - newNode = adm.insertChildBefore(sid, nodeRef); - debug && console.log('Inserted 1st node', role); - newNode && adm.setSelected(newNode); - } else { - console.warn('Insert 1st child failed:', role); - } - } - } - }; - window.top.$.rib = window.top.$.rib || {}; window.top.$.rib.dndfilter = dndfilter; @@ -385,7 +333,7 @@ $(function() { } }; $(e.target).subtree().add(document) - .unbind('click vmousedown vmousecancel vmouseup vmouseover focus' + .unbind('click vmousedown vmousecancel vmouseup vmouseover focus focusin' + ' vmouseout blur mousedown touchmove'); $(e.target).subtree('.adm-node:not(.delegation),.orig-adm-node').each( @@ -557,7 +505,8 @@ $(function() { // Collapsible's items are under .ui-collapsible-content '> .ui-collapsible-content > .adm-node,' + '> ul > li.adm-node,' + - '> div > .adm-node,' + + '> div > div > a > .adm-node,' + + '> div.customHeader > .adm-node,' + '> *.orig-adm-node:not(.ui-header,.ui-content,.ui-footer)', start: function(event, ui){ trackOffsets('start: ',ui,$(this).data('sortable')); @@ -642,16 +591,14 @@ $(function() { }, stop: function(event, ui){ trackOffsets('stop: ',ui,$(this).data('sortable')); - var type, isDrop, + var isDrop, pid = $(this).attr('data-uid'), - node = null, adm = window.parent.ADM, - bw = window.parent.BWidget, root = adm.getDesignRoot(), - node, zones, newParent, newZone, - rdx, idx, cid, pid, sid, + nodeRef, newParent, newNode, + cid, pid, sibling, children, parent, - role, card; + role, prevItem = ui.item, nextItem = ui.item; role = $(this).attr('data-role') || ''; @@ -702,87 +649,53 @@ $(function() { ui.item.remove(); return false; } - - // Drop from palette: add a node if (isDrop) { if (ui.item.data('adm-node')) { - type = ui.item.data('adm-node').type; + nodeRef = ui.item.data('adm-node').type; } - if (!type) { + if (!nodeRef) { console.warn('Drop failed: Missing node type'); ui.item.remove(); return false; } - - children = $($(this).sortable('option', 'items'), this) - .add(ui.item); - addNewNodeOnDrop(this, children, adm, pid, type, - role, ui.item); - ui.item.remove(); - return; - - // Sorted from layoutView: move a node - } else { - children = ui.item.parent().children('.adm-node') - .add(ui.item); - idx = children.index(ui.item); + } + else { cid = ui.item.attr('data-uid'); // closest() will select current element if it matches // the selector, so we start with its parent. + nodeRef = cid && root.findNodeByUid(cid); + if (event && event.ctrlKey) { + nodeRef = adm.copySubtree(nodeRef); + } + } + + while (prevItem[0] || nextItem[0]) { + prevItem = prevItem.prev('.adm-node'); + if (prevItem[0] && (newNode = adm.insertChildAfter + (prevItem.attr('data-uid'), nodeRef))) + break; + nextItem = nextItem.next('.adm-node'); + if (nextItem[0] && (newNode = adm.insertChildBefore + (nextItem.attr('data-uid'), nodeRef))) + break; + } + if (!prevItem[0] && !nextItem[0]) { pid = ui.item.parent() .closest('.adm-node.ui-sortable,'+ '.orig-adm-node.ui-sortable') .attr('data-uid'); - node = cid && root.findNodeByUid(cid); - if (event && event.ctrlKey) { - node = adm.copySubtree(node); // Clone it - addNewNodeOnDrop(this, children, adm, pid, node, - role, ui.item); - } else { - newParent = pid && root.findNodeByUid(pid); - zones = newParent && bw.getZones(newParent.getType()); - card = newParent && zones && - bw.getZoneCardinality(newParent.getType(), - zones[0]); - - // Notify the ADM that element has been moved - if ((zones && zones.length===1 && card !== '1')) { - if (!node || - !adm.moveNode(node, newParent, zones[0], - idx)) { - console.warn('Move node failed'); - ui.item.remove(); - return false; - } else { - debug && console.log('Move node worked'); - if (node) adm.setSelected(node.getUid()); - } - } else if (node && newParent && - newParent.getType() === 'Header') { - for (var z=0; z < zones.length; z++) { - if (adm.moveNode(node, newParent, zones[z], - 0, true)) { - newZone = zones[z]; - break; - } - } - if (newZone) { - adm.moveNode(node, newParent, newZone, 0); - debug && console.log('Move node worked'); - if (node) adm.setSelected(node.getUid()); - } else { - console.warn('Move node failed'); - ui.item.remove(); - return false; - } - } else { - console.warn('Move node failed: invalid zone'); + newParent = pid && root.findNodeByUid(pid); + if (!(newNode = adm.addChild(newParent, nodeRef))) { + if (isDrop) { ui.item.remove(); - return false; + return true; } + return false; } } + if (newNode) + adm.setSelected(newNode); } }) .bind('mousedown.composer', function(event) { diff --git a/src/js/projects.js b/src/js/projects.js index df82845f..7209ba88 100644 --- a/src/js/projects.js +++ b/src/js/projects.js @@ -27,7 +27,7 @@ $(function () { // Filter to find sandbox resources relativeFilter:{ type: "url-uploadable", - value: /^(?!(https?|ftp):\/+).+/i + value: /^(?!((https?|ftp):|src)\/+).+/i }, // Object to save refernce count for sandbox resource resourceRef: {}, diff --git a/src/js/serialize.js b/src/js/serialize.js index 533b1cab..555ec92f 100644 --- a/src/js/serialize.js +++ b/src/js/serialize.js @@ -425,11 +425,23 @@ $(function () { } function getDesignHeaders(design, useSandboxUrl) { - var i, props, el, designRoot, headers; + var i, props, el, designRoot, headers, toCorrectPath; designRoot = design || ADM.getDesignRoot(); headers = []; props = designRoot.getProperty('metas'); + toCorrectPath = function (header) { + var path = header.value; + // If need to use sandbox url + if (header.inSandbox) { + if (useSandboxUrl) { + path = toSandboxUrl(path); + } else { + path = path.replace(/^\//, ''); + } + } + return path; + }; for (i in props) { // Skip design only header properties if (props[i].hasOwnProperty('designOnly') && props[i].designOnly) { @@ -444,12 +456,7 @@ $(function () { if ((typeof props[i].value !== 'string') || (props[i].value.length <= 0)) { continue; } - // If need to use sandbox url - if (useSandboxUrl && props[i].inSandbox) { - el = el + '="' + toSandboxUrl(props[i].value) + '"'; - } else { - el = el + '="' + props[i].value + '"'; - } + el = el + '="' + toCorrectPath(props[i]) + '"'; if (props[i].hasOwnProperty('content')) { el = el + ' content="' + props[i].content + '"'; } @@ -470,11 +477,7 @@ $(function () { } el = ''; headers.push(el); } @@ -492,11 +495,7 @@ $(function () { } el = ''; headers.push(el); } diff --git a/src/js/views/code.js b/src/js/views/code.js index ce22af5a..bef6497d 100644 --- a/src/js/views/code.js +++ b/src/js/views/code.js @@ -47,6 +47,8 @@ selected = activePage.getUid(); } } + if (selected) + widget._selectCode(widget._htmlDoc.doc, selected); }, refresh: function(event, widget) { diff --git a/src/js/views/layout.js b/src/js/views/layout.js index e925c36c..98fa2f0f 100644 --- a/src/js/views/layout.js +++ b/src/js/views/layout.js @@ -428,15 +428,6 @@ // these lines. $(domNode).removeAttr('disabled'); $(domNode).children().removeAttr('disabled'); - - // Set default src for empty image to make them show up - // TODO: This case may need to improve, such as we can show a box - // with "empty image" message to notice the user - if ((admNode.getType() === "Image") && (!admNode.getProperty('src'))) { - if ($(domNode).is('img')) { - $(domNode).attr('src', "src/css/images/widgets/tizen_image.svg"); - } - } } }); })(jQuery); diff --git a/src/js/views/live.js b/src/js/views/live.js index 195657f7..075479ce 100644 --- a/src/js/views/live.js +++ b/src/js/views/live.js @@ -17,7 +17,9 @@ options: { iframe: null, - contentDocument: null + contentDocument: null, + maxDeviceSize: 10000, + minDeviceSize: 240, }, _create: function() { @@ -31,7 +33,9 @@ rotateDeviceButton, widget = this, screenCoordElement = function (name, min, className) { - return $('') + return $('') .attr("name", name) .addClass(className); }, @@ -72,6 +76,7 @@ buttonSet.append($('').click(function () { var type = widget._projectDevice.type; delete widget._userDevices[widget._projectDevice.name]; + widget._findOptionByText(widget._recentDevices, widget._projectDevice.name).remove(); applyDeviceChange(deviceForm, type); })); deviceForm @@ -168,7 +173,8 @@ .append("") .appendTo(devicePanel); - widget._recentDevices = $('') + .appendTo(deviceToolbar) .append('') .change(function() { $("option:selected", this).each(function () { @@ -273,6 +279,18 @@ .addClass("rotateDevice separated") .appendTo(deviceToolbar) .click( function () { + if (widget._screenWidth.val() < widget.options.minDeviceSize || + widget._screenHeight.val() < widget.options.minDeviceSize) { + alert("Device size should not be less than " + + widget.options.minDeviceSize); + return; + } + else if (widget._screenWidth.val() > widget.options.maxDeviceSize || + widget._screenHeight.val() > widget.options.maxDeviceSize) { + alert("Device size should not be greater than " + + widget.options.maxDeviceSize); + return; + } widget._projectDevice.rotating = !widget._projectDevice.rotating; widget._projectDevice.screenWidth = widget._screenHeight.val(); widget._projectDevice.screenHeight = widget._screenWidth.val(); @@ -423,7 +441,7 @@ $('
  • ').append( key ) .attr('id', key) .append( - $('>').addClass('fr') + $('').addClass('fr') ) .append( $('