diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/selectOnFocus.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/selectOnFocus.directive.js new file mode 100644 index 0000000000..4e2809f4dd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/directives/selectOnFocus.directive.js @@ -0,0 +1,8 @@ +angular.module("umbraco.directives") + .directive('selectOnFocus', function () { + return function (scope, el, attrs) { + $(el).bind("click", function(){ + this.select(); + }); + }; + }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbheader.directive.js index 032ef08ab1..8701161a23 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbheader.directive.js @@ -12,8 +12,11 @@ angular.module("umbraco.directives") }, link: function (scope, iElement, iAttrs) { + var maxTabs = 5; + function collectFromDom(activeTab){ var $panes = $('div.tab-content'); + $panes.find('.tab-pane').each(function (index) { var $this = angular.element(this); var id = $this.attr("rel"); @@ -31,44 +34,44 @@ angular.module("umbraco.directives") $this.removeClass('active'); } - //this is sorta hacky since we add a tab object to the tabs collection - //based on a dom element, there is most likely a better way... - if (label) { - scope.collectedTabs.push(tab); + + //scope.visibleTabs.push(tab); + + + if(label && (scope.visibleTabs.length < maxTabs || tab.id === 0)){ + scope.visibleTabs.push(tab); + }else{ + scope.overflownTabs.push(tab); } + }); + } scope.showTabs = iAttrs.tabs ? true : false; - scope.collectedTabs = []; + scope.visibleTabs = []; + scope.overflownTabs = []; $timeout(function () { - collectFromDom(undefined); - }, 500); + collectFromDom(undefined); + }, 500); //when the tabs change, we need to hack the planet a bit and force the first tab content to be active, //unfortunately twitter bootstrap tabs is not playing perfectly with angular. scope.$watch("tabs", function (newValue, oldValue) { $(newValue).each(function(i, val){ - scope.collectedTabs.push({id: val.id, label: val.label}); + scope.visibleTabs.push({id: val.id, label: val.label}); }); - //scope.collectedTabs = newValue; - + //don't process if we cannot or have already done so if (!newValue) {return;} - //if (hasProcessed || !newValue.length || newValue.length == 0) return; if (!newValue.length || newValue.length === 0){return;} - //set the flag - //hasProcessed = true; - - var activeTab = _.find(newValue, function (item) { return item.active; }); - //we need to do a timeout here so that the current sync operation can complete // and update the UI, then this will fire and the UI elements will be available. $timeout(function () { diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_utils.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_utils.js index 31eeb07865..e0efcc39ab 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_utils.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_utils.js @@ -84,8 +84,56 @@ angular.module('umbraco.mocks'). ] }, { - label: "Grid", + label: "This", id: 4, + properties: [ + { alias: "valTest4", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText4", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

askjdkasj lasjd

", config: {} }, + { alias: "textarea4", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "map4", label: "Map", view: "googlemaps", value: "37.4419,-122.1419", config: { mapType: "ROADMAP", zoom: 4 } }, + + { alias: "content4", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Is", + id: 5, + properties: [ + { alias: "valTest5", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText5", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

askjdkasj lasjd

", config: {} }, + { alias: "textarea5", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "map5", label: "Map", view: "googlemaps", value: "37.4419,-122.1419", config: { mapType: "ROADMAP", zoom: 4 } }, + + { alias: "content5", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Overflown", + id: 6, + properties: [ + { alias: "valTest6", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText6", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

askjdkasj lasjd

", config: {} }, + { alias: "textarea6", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "map6", label: "Map", view: "googlemaps", value: "37.4419,-122.1419", config: { mapType: "ROADMAP", zoom: 4 } }, + + { alias: "content6", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Tab # 7", + id: 7, + properties: [ + { alias: "valTest7", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText7", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

askjdkasj lasjd

", config: {} }, + { alias: "textarea7", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "map7", label: "Map", view: "googlemaps", value: "37.4419,-122.1419", config: { mapType: "ROADMAP", zoom: 4 } }, + + { alias: "content7", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Grid", + id: 8, properties: [ { alias: "grid", label: "Grid", view: "grid", value: "test", hideLabel: true } ] diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/services/localization.mocks.js b/src/Umbraco.Web.UI.Client/src/common/mocks/services/localization.mocks.js index 286622e05e..adb28ce045 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/services/localization.mocks.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/services/localization.mocks.js @@ -212,6 +212,7 @@ angular.module('umbraco.mocks'). "placeholders_username": "Enter your username", "placeholders_password": "Enter your password", "placeholders_entername": "Enter a name...", + "placeholders_nameentity": "Name the %0%...", "placeholders_search": "Type to search...", "placeholders_filter": "Type to filter...", "editcontenttype_allowedchildnodetypes": "Allowed child nodetypes", diff --git a/src/Umbraco.Web.UI.Client/src/views/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/content/edit.html index ca34a15b25..2e699440e0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/edit.html @@ -6,15 +6,18 @@ -
- + + + {{content.contentTypeName}}
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-header.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-header.html index 9e29a43323..a689f13dc3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-header.html @@ -4,9 +4,22 @@
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/test/unit/app/content/edit-content-controller.spec.js b/src/Umbraco.Web.UI.Client/test/unit/app/content/edit-content-controller.spec.js index 34744c6e60..5fe4354222 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/app/content/edit-content-controller.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/app/content/edit-content-controller.spec.js @@ -47,7 +47,7 @@ describe('edit content controller tests', function () { }); it('it should have a tabs collection', function () { - expect(scope.content.tabs.length).toBe(5); + expect(scope.content.tabs.length).toBe(9); }); it('it should have a properties collection on each tab', function () { diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 56c55e99d3..0916d50fb8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -241,7 +241,7 @@ Enter your username Enter your password - + Name the %0%... Enter a name... Type to search... Type to filter... @@ -353,6 +353,7 @@ Logout Macro Move + More Name New Next