Skip to content

Commit

Permalink
Item13069: fix processing of foswikiPreferences
Browse files Browse the repository at this point in the history
- added event locationChanged
  • Loading branch information
MichaelDaum committed Mar 8, 2016
1 parent b2f2bc2 commit 0574094
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 28 deletions.
32 changes: 17 additions & 15 deletions data/System/AngularSkin.txt
@@ -1,5 +1,5 @@
---+!! %TOPIC%
%SHORTDESCRIPTION%
%FORMFIELD{"Description"}%

%TOC%

Expand All @@ -11,18 +11,20 @@

%$INSTALL_INSTRUCTIONS%

---++ Info
<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

| Author(s): | Michael Daum|
| Copyright: | &copy; 2014-2015 Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
---++ Dependencies
%$DEPENDENCIES%

---++ Change History
| 08 Mar 2016: | second alpha release |
| 27 Feb 2015: | first alpha release |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | Foswiki:Extensions/%TOPIC% |
| Support: | Foswiki:Support/%TOPIC% |

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2014-2016 Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/%TOPIC%"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%TOPIC%"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%
6 changes: 3 additions & 3 deletions lib/Foswiki/Contrib/AngularSkin.pm
@@ -1,6 +1,6 @@
# Extension for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# AngularSkin is Copyright (C) 2014-2015 Michael Daum http://michaeldaumconsulting.com
# AngularSkin is Copyright (C) 2014-2016 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -20,8 +20,8 @@ use warnings;

use Foswiki::Func ();

our $VERSION = '1.00_0001';
our $RELEASE = '27 Feb 2015';
our $VERSION = '1.00_0002';
our $RELEASE = '08 Mar 2016';
our $SHORTDESCRIPTION = 'Angular Skin for Foswiki';
our $NO_PREFS_IN_TOPIC = 1;

Expand Down
2 changes: 2 additions & 0 deletions pub/System/AngularSkin/controller.uncompressed.js
Expand Up @@ -92,13 +92,15 @@ app.controller("ViewCtrl", [
return false;
}


if (web !== prevWeb || topic !== prevTopic) {
$scope.web = prevWeb = web;
$scope.topic = prevTopic = topic;
prevUrl = url;
if (isFirst) {
isFirst = false;
} else {
angular.element(window).trigger("locationChanged");
return true;
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions pub/System/AngularSkin/pkg.uncompressed.js
Expand Up @@ -300,13 +300,15 @@ app.controller("ViewCtrl", [
return false;
}


if (web !== prevWeb || topic !== prevTopic) {
$scope.web = prevWeb = web;
$scope.topic = prevTopic = topic;
prevUrl = url;
if (isFirst) {
isFirst = false;
} else {
angular.element(window).trigger("locationChanged");
return true;
}
} else {
Expand Down
20 changes: 10 additions & 10 deletions templates/foswiki.angular.tmpl
Expand Up @@ -11,11 +11,11 @@
%TMPL:DEF{"javascript::angular::prefs"}%%ADDTOZONE{"script"
requires="JQUERYPLUGIN::FOSWIKI::PREFERENCES"
id="ANGULARSKIN::PREFERENCES"
text="<script type='text/javascript'>
jQuery.extend(foswiki.preferences, {
'ANGULAR_EXCLUDE':'%QUERY{"{AngularPlugin}{Exclude}"}%'
});
</script>"
text="<script class='$zone $id foswikiPreferences' type='text/json'>{
\"Angular\": {
\"topicFilter\": $percntQUERY{\"{AngularPlugin}{Exclude}\" style=\"json\"}$percnt
}
}</script>"
}%%JQREQUIRE{"ngCore, loadingBar"}%%TMPL:END%

%TMPL:DEF{"javascript::angular::prod"}%%ADDTOZONE{
Expand All @@ -29,11 +29,11 @@ jQuery.extend(foswiki.preferences, {
"script"
id="ANGULARSKIN"
requires="ANGULARPLUGIN::NGCORE, ANGULARPLUGIN::NGROUTE"
text="<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/app.uncompressed.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/settings.uncompressed.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/controller.uncompressed.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/directives.uncompressed.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/services.uncompressed.js'></script>"
text="<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/app.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/settings.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/controller.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/directives.js'></script>
<script src='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/services.js'></script>"
}%%TMPL:END%

%TMPL:DEF{"css::angular"}%%ADDTOZONE{
Expand Down

0 comments on commit 0574094

Please sign in to comment.