-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn if note is saved and window would be closed, fix #52
- Loading branch information
Bernhard Posselt
committed
Feb 20, 2015
1 parent
588795e
commit d20e28c
Showing
16 changed files
with
183 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright (c) 2013, Bernhard Posselt <[email protected]> | ||
* This file is licensed under the Affero General Public License version 3 or later. | ||
* See the COPYING file. | ||
*/ | ||
|
||
app.directive('notesIsSaving', function ($window) { | ||
return { | ||
restrict: 'A', | ||
scope: { | ||
'notesIsSaving': '=' | ||
}, | ||
link: function (scope, element, attributes) { | ||
$window.onbeforeunload = function () { | ||
if (scope.notesIsSaving) { | ||
return t('notes', 'Note is currently saving. Leaving ' + | ||
'the page will delete all changes!'); | ||
} else { | ||
return null; | ||
} | ||
}; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/** | ||
* Copyright (c) 2013, Bernhard Posselt <[email protected]> | ||
* This file is licensed under the Affero General Public License version 3 or later. | ||
* See the COPYING file. | ||
* See the COPYING file. | ||
*/ | ||
|
||
app.factory('Config', ['Restangular', function (Restangular) { | ||
app.factory('Config', function (Restangular) { | ||
var Config = function (Restangular) { | ||
this._markdown = false; | ||
this._Restangular = Restangular; | ||
|
@@ -32,4 +32,4 @@ app.factory('Config', ['Restangular', function (Restangular) { | |
}; | ||
|
||
return new Config(Restangular); | ||
}]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
{ | ||
"name": "notes", | ||
"description": "Notes app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"homepage": "https://github.com/owncloud/notes", | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:owncloud/notes.git" | ||
}, | ||
"bugs": "https://github.com/owncloud/notes/issues", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"grunt": "*", | ||
"grunt-cli": "*", | ||
"grunt-contrib-concat": "*", | ||
"grunt-contrib-jshint": "*", | ||
"grunt-contrib-watch": "*", | ||
"karma": "*", | ||
"grunt-karma": "*", | ||
"grunt-wrap": "*", | ||
"phantomjs": "*", | ||
"grunt-phpunit": "*", | ||
"bower": "*", | ||
"karma-jasmine": "*", | ||
"karma-phantomjs-launcher": "*", | ||
"karma-chrome-launcher": "*", | ||
"karma-firefox-launcher": "*" | ||
}, | ||
"engine": "node >= 0.8" | ||
} | ||
"name": "notes", | ||
"description": "Notes app", | ||
"version": "0.0.1", | ||
"private": true, | ||
"homepage": "https://github.com/owncloud/notes", | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:owncloud/notes.git" | ||
}, | ||
"bugs": "https://github.com/owncloud/notes/issues", | ||
"dependencies": { | ||
"grunt-ng-annotate": "^0.10.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "*", | ||
"grunt-cli": "*", | ||
"grunt-contrib-concat": "*", | ||
"grunt-contrib-jshint": "*", | ||
"grunt-contrib-watch": "*", | ||
"karma": "*", | ||
"grunt-karma": "*", | ||
"grunt-wrap": "*", | ||
"phantomjs": "*", | ||
"grunt-phpunit": "*", | ||
"bower": "*", | ||
"karma-jasmine": "*", | ||
"karma-phantomjs-launcher": "*", | ||
"karma-chrome-launcher": "*", | ||
"karma-firefox-launcher": "*" | ||
}, | ||
"engine": "node >= 0.8" | ||
} |
Oops, something went wrong.