Fixed up external templated directives to use the templateUrl property which i didn't previously know about, this ensures that a new scope is not created for these elements which was causing issues. updated ignore file some more, removed committed files that shouldn't be there

This commit is contained in:
Shannon
2013-06-17 04:51:59 +02:00
parent b50658121d
commit c52e51b2d8
13 changed files with 126 additions and 151 deletions

46
.gitignore vendored
View File

@@ -23,11 +23,11 @@ _NCrunch_*/
umbraco.config
*.vs10x
App_Data/TEMP/*
umbraco/presentation/umbraco/plugins/*
umbraco/presentation/usercontrols/*
umbraco/presentation/scripts/*
umbraco/presentation/fonts/*
umbraco/presentation/css/*
[Uu]mbraco/[Pp]resentation/[Uu]mbraco/[Pp]lugins/*
[Uu]mbraco/[Pp]resentation/[Uu]ser[Cc]ontrols/*
[Uu]mbraco/[Pp]resentation/[Ss]cripts/*
[Uu]mbraco/[Pp]resentation/[Ff]onts/*
[Uu]mbraco/[Pp]resentation/[Cc]ss/*
src/Umbraco.Web.UI/[Cc]ss/*
src/Umbraco.Web.UI/App_Code/*
@@ -44,7 +44,6 @@ src/Umbraco.Web.UI/Web.*.config.transformed
umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx
umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx
_BuildOutput/*
*.ncrunchsolution
build/UmbracoCms.AllBinaries*zip
build/UmbracoCms.WebPI*zip
build/UmbracoCms*zip
@@ -54,29 +53,28 @@ src/Umbraco.Tests/config/trees.config
src/Umbraco.Web.UI/web.config
*.orig
src/Umbraco.Tests/config/404handlers.config
src/Umbraco.Web.UI/Views/*.cshtml
src/Umbraco.Web.UI/Views/*.vbhtml
src/Umbraco.Tests/config/umbracoSettings.config
src/Umbraco.Web.UI/Views/*
src/Umbraco.Web.UI/[Vv]iews/*.cshtml
src/Umbraco.Web.UI/[Vv]iews/*.vbhtml
src/Umbraco.Tests/[Cc]onfig/umbracoSettings.config
src/Umbraco.Web.UI/[Vv]iews/*
src/packages/
src/packages/repositories.config
src/Umbraco.Web.UI/[W]eb.config
src/Umbraco.Web.UI/[Ww]eb.config
*.transformed
webpihash.txt
node_modules
src/Umbraco.Web.UI/umbraco/lib/*
src/Umbraco.Web.UI/umbraco/js/umbraco.*
src/Umbraco.Web.UI/umbraco/js/routes.js
src/Umbraco.Web.UI/umbraco/js/main.js
src/Umbraco.Web.UI/umbraco/js/app.js
src/Umbraco.Web.UI/umbraco/Views/**/*.js
src/Umbraco.Web.UI/umbraco/Views/**/*.css
src/Umbraco.Web.UI/umbraco/Views/**/*.html
src/Umbraco.Web.UI/umbraco/assets/*
src/Umbraco.Web.UI.Client/build/*
src/Umbraco.Web.UI.Client/build/*
src/Umbraco.Web.UI.Client/build/belle/
src/Umbraco.Web.UI/UserControls/
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/*
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/umbraco.*
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html
src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
src/Umbraco.Web.UI.Client/[Bb]uild/*
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
build/_BuildOutput/

View File

@@ -80,7 +80,12 @@ angular.module('umbraco').controller("MainController",
var d = new Date();
var weekday = new Array("Super Sunday", "Manic Monday", "Tremendous Tuesday", "Wonderfull Wednesday", "Thunder Thursday", "Friendly Friday", "Shiny Saturday");
$scope.today = weekday[d.getDay()];
//set properties
$scope.authenticated = userService.authenticated;
$scope.login = "Hello";
$scope.password = "World";
$scope.signin = function () {
@@ -97,7 +102,6 @@ angular.module('umbraco').controller("MainController",
userService.signout();
$scope.authenticated = false;
};
//subscribes to notifications in the notification service
$scope.notifications = notificationsService.current;
@@ -120,7 +124,7 @@ angular.module('umbraco').controller("MainController",
}
};
if (userService.authenticated) {
if ($scope.authenticated) {
$scope.signin();
}
});

View File

@@ -1,11 +1,12 @@
<!-- Login screen -->
<div id="login" ng-show="!authenticated" ng-animate="'slide'" ng-cloak>
<div class="form" ng-cloak>
<h1>Happy {{today}}!, log in below</h1>
<div class="control-group">
<input type="text" ng-model="login" class="input-xlarge" placeholder="Enter your username" /></div>
<input type="text" ng-model="login" class="input-xlarge" placeholder="Enter your username" />
</div>
<div class="control-group">
<input type="password" ng-model="password" class="input-xlarge" placeholder="Enter your password" /></div>
<input type="password" ng-model="password" class="input-xlarge" placeholder="Enter your password" />
</div>
<input type="button" ng-click="signin()" class="btn" value="Login" />
</div>
</div>

View File

@@ -1,4 +1,3 @@
<!-- notifications -->
<div id='speechbubble' class='umb-notification' ng-cloak>
<ul>
<li ng-repeat="notification in notifications" class="alert alert-block alert-{{notification.type}}">

View File

@@ -1,18 +1,14 @@
/**
* @ngdoc directive
* @name umbraco.directive:leftColumn
* @restrict E
**/
function leftColumnDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
template: '<div ng-include="leftColumnViewFile"></div>',
link: function (scope, el, attrs) {
//set the loginViewFile
scope.leftColumnViewFile = "views/directives/umb-leftcolumn.html";
}
};
}
angular.module('umbraco.directives').directive("umbLeftColumn", leftColumnDirective);
/**
* @ngdoc directive
* @name umbraco.directive:leftColumn
* @restrict E
**/
function leftColumnDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
templateUrl: 'views/directives/umb-leftcolumn.html'
};
}
angular.module('umbraco.directives').directive("umbLeftColumn", leftColumnDirective);

View File

@@ -1,18 +1,14 @@
/**
* @ngdoc directive
* @name umbraco.directive:login
* @restrict E
**/
function loginDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
template: '<div ng-include="loginViewFile"></div>',
link: function (scope, el, attrs) {
//set the loginViewFile
scope.loginViewFile = "views/directives/umb-login.html";
}
};
}
angular.module('umbraco.directives').directive("umbLogin", loginDirective);
/**
* @ngdoc directive
* @name umbraco.directive:login
* @restrict E
**/
function loginDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
templateUrl: 'views/directives/umb-login.html'
};
}
angular.module('umbraco.directives').directive("umbLogin", loginDirective);

View File

@@ -1,18 +1,14 @@
/**
* @ngdoc directive
* @name umbraco.directive:notifications
* @restrict E
**/
function notificationDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
template: '<div ng-include="notificationViewFile"></div>',
link: function (scope, el, attrs) {
//set the notificationViewFile
scope.notificationViewFile = "views/directives/umb-notifications.html";
}
};
}
/**
* @ngdoc directive
* @name umbraco.directive:notifications
* @restrict E
**/
function notificationDirective() {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
templateUrl: 'views/directives/umb-notifications.html'
};
}
angular.module('umbraco.directives').directive("umbNotifications", notificationDirective);

View File

@@ -1,53 +1,53 @@
angular.module('umbraco.services')
.factory('userService', function (authResource, $q) {
var _currentUser,_authenticated = (jQuery.cookie('UMB_UCONTEXT') != "");
var currentUser;
var authenticated = (jQuery.cookie('UMB_UCONTEXT') != null && jQuery.cookie('UMB_UCONTEXT') != "");
//var _mockedU = {
// name: "Per Ploug",
// avatar: "assets/img/avatar.jpeg",
// id: 0,
// authenticated: true,
// locale: 'da-DK'
//};
//var _mockedU = {
// name: "Per Ploug",
// avatar: "assets/img/avatar.jpeg",
// id: 0,
// authenticated: true,
// locale: 'da-DK'
//};
//if(_authenticated){
// _currentUser = _mockedU;
//}
//if(_authenticated){
// _currentUser = _mockedU;
//}
return {
authenticated: _authenticated,
currentUser: _currentUser,
authenticate: function(login, password) {
return {
authenticated: authenticated,
var deferred = $q.defer();
authenticate: function (login, password) {
authResource.performLogin(login, password)
.then(function (data) {
_currentUser = data;
_authenticated = true;
deferred.resolve({user: data, authenticated: true});
},
function (reason) {
deferred.reject(reason);
_authenticated = false;
var deferred = $q.defer();
authResource.performLogin(login, password)
.then(function (data) {
currentUser = data;
authenticated = true;
deferred.resolve({ user: data, authenticated: true });
},
function (reason) {
deferred.reject(reason);
authenticated = false;
});
return deferred.promise;
},
logout: function () {
$rootScope.$apply(function () {
authenticated = false;
jQuery.cookie('authed', null);
currentUser = undefined;
});
},
return deferred;
},
logout: function(){
$rootScope.$apply(function() {
_authenticated = false;
jQuery.cookie('authed', null);
_currentUser = undefined;
});
},
getCurrentUser: function () {
return currentUser;
}
};
getCurrentUser: function(){
return _currentUser;
}
};
});

View File

@@ -80,7 +80,12 @@ angular.module('umbraco').controller("MainController",
var d = new Date();
var weekday = new Array("Super Sunday", "Manic Monday", "Tremendous Tuesday", "Wonderfull Wednesday", "Thunder Thursday", "Friendly Friday", "Shiny Saturday");
$scope.today = weekday[d.getDay()];
//set properties
$scope.authenticated = userService.authenticated;
$scope.login = "";
$scope.password = "";
$scope.signin = function () {
@@ -97,7 +102,6 @@ angular.module('umbraco').controller("MainController",
userService.signout();
$scope.authenticated = false;
};
//subscribes to notifications in the notification service
$scope.notifications = notificationsService.current;
@@ -120,7 +124,7 @@ angular.module('umbraco').controller("MainController",
}
};
if (userService.authenticated) {
if ($scope.authenticated) {
$scope.signin();
}
});

View File

@@ -1,11 +1,12 @@
<!-- Login screen -->
<div id="login" ng-show="!authenticated" ng-animate="'slide'" ng-cloak>
<div class="form" ng-cloak>
<h1>Happy {{today}}!, log in below</h1>
<div class="control-group">
<input type="text" ng-model="login" class="input-xlarge" placeholder="Enter your username" /></div>
<input type="text" ng-model="login" class="input-xlarge" placeholder="Enter your username" />
</div>
<div class="control-group">
<input type="password" ng-model="password" class="input-xlarge" placeholder="Enter your password" /></div>
<input type="password" ng-model="password" class="input-xlarge" placeholder="Enter your password" />
</div>
<input type="button" ng-click="signin()" class="btn" value="Login" />
</div>
</div>

View File

@@ -1,4 +1,3 @@
<!-- notifications -->
<div id='speechbubble' class='umb-notification' ng-cloak>
<ul>
<li ng-repeat="notification in notifications" class="alert alert-block alert-{{notification.type}}">

View File

@@ -1,11 +0,0 @@
<!-- Login screen -->
<div id="login" ng-show="!authenticated" ng-animate="'slide'" ng-cloak>
<div class="form" ng-cloak>
<h1>Happy {{today}}!, log in below</h1>
<div class="control-group">
<input type="text" ng-model="login" class="input-xlarge" placeholder="Enter your username" /></div>
<div class="control-group">
<input type="password" ng-model="password" class="input-xlarge" placeholder="Enter your password" /></div>
<input type="button" ng-click="signin()" class="btn" value="Login" />
</div>
</div>

View File

@@ -1,8 +0,0 @@
<!-- notifications -->
<div id='speechbubble' class='umb-notification' ng-cloak>
<ul>
<li ng-repeat="notification in notifications" class="alert alert-block alert-{{notification.type}}">
<strong>{{notification.headline}}:</strong>{{notification.message}}<a class='close' ng-click="removeNotification($index)" prevent-default href='#'>&times;</a>
</li>
</ul>
</div>