From c683eab9e2a22efa795163f8115f370a67957e18 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 17 Jul 2014 17:05:39 +0100 Subject: [PATCH] change the scribtex modal to be bootstrap3/angular, same content and same logic if it should be shown or not --- services/web/app/views/layout.jade | 14 ++++---------- services/web/app/views/scribtex-modal.jade | 8 ++++++++ services/web/public/coffee/main.coffee | 1 + .../web/public/coffee/main/scribtex-popup.coffee | 9 +++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 services/web/app/views/scribtex-modal.jade create mode 100644 services/web/public/coffee/main/scribtex-popup.coffee diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 0b374dd0ab..2e59b6a48f 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -43,17 +43,11 @@ html(itemscope, itemtype='http://schema.org/Product') - if(typeof(suppressFooter) == "undefined") include layout/footer + + - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex) - .modal.hide#scribtexModal - .modal-header - h3 Looking for ScribTeX? - .modal-body - p ScribTeX has moved to https://scribtex.sharelatex.com. Please update your bookmarks. - p(style="text-align: center") You can find the page you were looking for here: - p(style="text-align: center") - a(href="https://scribtex.sharelatex.com#{scribtexPath}", style="font-size: 16px") https://scribtex.sharelatex.com#{scribtexPath} - .modal-footer - button(data-dismiss="modal").btn OK + span(ng-controller="ScribtexPopupController") + include scribtex-modal - if(typeof(suppressFooter) == "undefined") diff --git a/services/web/app/views/scribtex-modal.jade b/services/web/app/views/scribtex-modal.jade new file mode 100644 index 0000000000..1d4e2ce005 --- /dev/null +++ b/services/web/app/views/scribtex-modal.jade @@ -0,0 +1,8 @@ +script(type='text/ng-template', id='scribtexModalTemplate') + .modal-header + h3 Looking for ScribTeX? + .modal-body + p ScribTeX has moved to https://scribtex.sharelatex.com. Please update your bookmarks. + p(style="text-align: center") You can find the page you were looking for here: + p(style="text-align: center") + a(href="https://scribtex.sharelatex.com#{scribtexPath}", style="font-size: 16px") https://scribtex.sharelatex.com#{scribtexPath} \ No newline at end of file diff --git a/services/web/public/coffee/main.coffee b/services/web/public/coffee/main.coffee index 101f2dcab3..ed6b22404c 100644 --- a/services/web/public/coffee/main.coffee +++ b/services/web/public/coffee/main.coffee @@ -5,6 +5,7 @@ define [ "main/templates" "main/plans" "main/group-members" + "main/scribtex-popup" "directives/asyncForm" "directives/stopPropagation" "directives/focus" diff --git a/services/web/public/coffee/main/scribtex-popup.coffee b/services/web/public/coffee/main/scribtex-popup.coffee new file mode 100644 index 0000000000..d18993c0a0 --- /dev/null +++ b/services/web/public/coffee/main/scribtex-popup.coffee @@ -0,0 +1,9 @@ +define [ + "base" +], (App) -> + + App.controller 'ScribtexPopupController', ($scope, $modal) -> + + $modal.open { + templateUrl: "scribtexModalTemplate" + }