Actually let people end a tour.

This commit is contained in:
Dannon Baker
2015-12-18 13:20:57 -05:00
parent 9e7eaaa7aa
commit 5a3524245b
12 changed files with 56970 additions and 44 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+53 -1
View File
@@ -1,2 +1,54 @@
webpackJsonp([4],[function(e,r,n){(function(e){var r=n(1),a=r,i=n(82).GalaxyApp,o=n(13),t=n(5),l=n(84);window.app=function(n,c){window.Galaxy=new i(n,c),Galaxy.debug("login app");var d=encodeURI(n.redirect);if(!n.show_welcome_with_login){var w=r.param({use_panels:"True",redirect:d});return void(window.location.href=Galaxy.root+"user/login?"+w)}var p=new l.PageLayoutView(e.extend(n,{el:"body",center:new o.CenterPanel({el:"#center"}),right:new o.RightPanel({title:t("Login required"),el:"#right"})}));a(function(){var e=r.param({redirect:d}),a=Galaxy.root+"user/login?"+e;p.render(),p.center.$("#galaxy_main").prop("src",n.welcome_url),p.right.$(".unified-panel-body").css("overflow","hidden").html('<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>')})}}).call(r,n(3))}]);
webpackJsonp([5],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(_) {
var jQuery = __webpack_require__( 3 ),
$ = jQuery,
GalaxyApp = __webpack_require__( 4 ).GalaxyApp,
PANEL = __webpack_require__( 12 ),
_l = __webpack_require__( 7 ),
PAGE = __webpack_require__( 122 );
window.app = function app( options, bootstrapped ){
window.Galaxy = new GalaxyApp( options, bootstrapped );
Galaxy.debug( 'login app' );
var redirect = encodeURI( options.redirect );
// TODO: remove iframe for user login (at least) and render login page from here
// then remove this redirect
if( !options.show_welcome_with_login ){
var params = jQuery.param({ use_panels : 'True', redirect : redirect });
window.location.href = Galaxy.root + 'user/login?' + params;
return;
}
var loginPage = new PAGE.PageLayoutView( _.extend( options, {
el : 'body',
center : new PANEL.CenterPanel({ el : '#center' }),
right : new PANEL.RightPanel({
title : _l( 'Login required' ),
el : '#right'
}),
}));
$(function(){
// TODO: incorporate *actual* referrer/redirect info as the original page does
var params = jQuery.param({ redirect : redirect }),
loginUrl = Galaxy.root + 'user/login?' + params;
loginPage.render();
// welcome page (probably) needs to remain sandboxed
loginPage.center.$( '#galaxy_main' ).prop( 'src', options.welcome_url );
loginPage.right.$( '.unified-panel-body' )
.css( 'overflow', 'hidden' )
.html( '<iframe src="' + loginUrl + '" frameborder="0" style="width: 100%; height: 100%;"/>' );
});
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ }
]);
//# sourceMappingURL=login.bundled.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["libs/bootstrap-tour"],function(){var a=function(a){return _.each(a.steps,function(a){a.preclick&&(a.onShow=function(){$(a.preclick).click()}),a.postclick&&(a.onHide=function(){$(a.postclick).click()}),a.textinsert&&(a.onShown=function(){$(a.element).val(a.textinsert).trigger("change")})}),a},b=Backbone.Model.extend({urlRoot:Galaxy.root+"api/tours"}),c=Backbone.Collection.extend({url:Galaxy.root+"api/tours",model:b}),d=Backbone.View.extend({initialize:function(){var a=this;this.setElement("<div/>"),this.model=new c,this.model.fetch({success:function(){a.render()},error:function(){console.error("Failed to fetch tours.")}})},render:function(){var a=this,b=_.template(["<h2>Available Galaxy Tours</h2>","<ul>","<% _.each(tours, function(tour) { %>","<li>",'<a href="#" class="tourItem" data-tour.id=<%- tour.id %>>',"<%- tour.id %>","</a>","- <%- tour.attributes.description %>","</li>","<% }); %>","</ul>"].join(""));this.$el.html(b({tours:this.model.models,Galaxy:Galaxy})).on("click",".tourItem",function(){a.giveTour($(this).data("tour.id"))})},giveTour:function(b){var c=Galaxy.root+"api/tours/"+b;$.getJSON(c,function(b){tourdata=a(b),sessionStorage.setItem("activeGalaxyTour",JSON.stringify(b));var c=new Tour({storage:window.sessionStorage,steps:tourdata.steps,debug:!0});c.init(),c.goTo(0),c.restart()})}});return{ToursView:d,hooked_tour_from_data:a}});
define(["libs/bootstrap-tour"],function(){var a=function(a){return _.each(a.steps,function(a){a.preclick&&(a.onShow=function(){$(a.preclick).click()}),a.postclick&&(a.onHide=function(){$(a.postclick).click()}),a.textinsert&&(a.onShown=function(){$(a.element).val(a.textinsert).trigger("change")})}),a},b=Backbone.Model.extend({urlRoot:Galaxy.root+"api/tours"}),c=Backbone.Collection.extend({url:Galaxy.root+"api/tours",model:b}),d=Backbone.View.extend({initialize:function(){var a=this;this.setElement("<div/>"),this.model=new c,this.model.fetch({success:function(){a.render()},error:function(){console.error("Failed to fetch tours.")}})},render:function(){var a=this,b=_.template(["<h2>Available Galaxy Tours</h2>","<ul>","<% _.each(tours, function(tour) { %>","<li>",'<a href="#" class="tourItem" data-tour.id=<%- tour.id %>>',"<%- tour.id %>","</a>","- <%- tour.attributes.description %>","</li>","<% }); %>","</ul>"].join(""));this.$el.html(b({tours:this.model.models,Galaxy:Galaxy})).on("click",".tourItem",function(){a.giveTour($(this).data("tour.id"))})},giveTour:function(b){var c=Galaxy.root+"api/tours/"+b;$.getJSON(c,function(b){tourdata=a(b),sessionStorage.setItem("activeGalaxyTour",JSON.stringify(b));var c=new Tour({storage:window.sessionStorage,steps:tourdata.steps,debug:!0,onEnd:function(){sessionStorage.removeItem("activeGalaxyTour")}});c.init(),c.goTo(0),c.restart()})}});return{ToursView:d,hooked_tour_from_data:a}});
//# sourceMappingURL=../../maps/mvc/tours.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
function replace_big_select_inputs(a,b,c){function d(a){var b=$(a),c={placeholder:"Click to select",closeOnSelect:!b.is("[MULTIPLE]"),dropdownAutoWidth:!0,containerCssClass:"select2-minwidth"};return a.select2(c)}jQuery.fn.select2&&(void 0===a&&(a=20),void 0===b&&(b=3e3),c=c||$("select"),c.each(function(){var c=$(this).not("[multiple]"),e=c.find("option").length;a>e||e>b||c.hasClass("no-autocomplete")||d(c)}))}function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),$(document).trigger("convert_to_values"),a.get(0).form.submit()}),$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),a.get(0).form.submit()}),$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}window.jQuery=jQuery,window.$=jQuery,window._=_,window.Backbone=Backbone,window.Handlebars=Handlebars,window.panels=require("layout/panel"),_.extend(window,require("layout/modal")),window.async_save_text=require("utils/async-save-text");var POPUPMENU=require("ui/popupmenu");window.make_popupmenu=POPUPMENU.make_popupmenu,window.make_popup_menus=POPUPMENU.make_popup_menus,window.init_tag_click_function=require("ui/autocom_tagging");var TOURS=require("mvc/tours");window.init_refresh_on_change=init_refresh_on_change,$(document).ready(function(){var a=$("#masthead ul.nav > li.dropdown > .dropdown-menu");$("body").on("click.nav_popups",function(b){if(a.hide(),$("#dd-helper").hide(),!$(b.target).closest("#masthead ul.nav > li.dropdown > .dropdown-menu").length){var c=$(b.target).closest("#masthead ul.nav > li.dropdown");c.length&&($("#dd-helper").show(),c.children(".dropdown-menu").show(),b.preventDefault())}}),init_refresh_on_change(),$.fn.tooltip&&($(".unified-panel-header [title]").tooltip({placement:"bottom"}),$("[title]").tooltip()),make_popup_menus(),replace_big_select_inputs(20,1500),$("a").click(function(){var a=$(this),b=parent.frames&&parent.frames.galaxy_main;if("galaxy_main"==a.attr("target")&&!b){var c=a.attr("href");c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",a.attr("href",c),a.attr("target","_self")}return a});try{if(et=JSON.parse(sessionStorage.getItem("activeGalaxyTour")),et&&(et=TOURS.hooked_tour_from_data(et),et&&et.steps)){var b=new Tour({steps:et.steps,debug:!0});b.init(),b.restart()}}catch(c){console.log("Tour loading failure, you'll need to restart the tour manually."+c)}});
function replace_big_select_inputs(a,b,c){function d(a){var b=$(a),c={placeholder:"Click to select",closeOnSelect:!b.is("[MULTIPLE]"),dropdownAutoWidth:!0,containerCssClass:"select2-minwidth"};return a.select2(c)}jQuery.fn.select2&&(void 0===a&&(a=20),void 0===b&&(b=3e3),c=c||$("select"),c.each(function(){var c=$(this).not("[multiple]"),e=c.find("option").length;a>e||e>b||c.hasClass("no-autocomplete")||d(c)}))}function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),$(document).trigger("convert_to_values"),a.get(0).form.submit()}),$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),b=a.val(),c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var d=a.attr("last_selected_value");if(-1===$.inArray(b,c)&&-1===$.inArray(d,c))return}$(window).trigger("refresh_on_change"),a.get(0).form.submit()}),$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}window.jQuery=jQuery,window.$=jQuery,window._=_,window.Backbone=Backbone,window.Handlebars=Handlebars,window.panels=require("layout/panel"),_.extend(window,require("layout/modal")),window.async_save_text=require("utils/async-save-text");var POPUPMENU=require("ui/popupmenu");window.make_popupmenu=POPUPMENU.make_popupmenu,window.make_popup_menus=POPUPMENU.make_popup_menus,window.init_tag_click_function=require("ui/autocom_tagging");var TOURS=require("mvc/tours");window.init_refresh_on_change=init_refresh_on_change,$(document).ready(function(){var a=$("#masthead ul.nav > li.dropdown > .dropdown-menu");$("body").on("click.nav_popups",function(b){if(a.hide(),$("#dd-helper").hide(),!$(b.target).closest("#masthead ul.nav > li.dropdown > .dropdown-menu").length){var c=$(b.target).closest("#masthead ul.nav > li.dropdown");c.length&&($("#dd-helper").show(),c.children(".dropdown-menu").show(),b.preventDefault())}}),init_refresh_on_change(),$.fn.tooltip&&($(".unified-panel-header [title]").tooltip({placement:"bottom"}),$("[title]").tooltip()),make_popup_menus(),replace_big_select_inputs(20,1500),$("a").click(function(){var a=$(this),b=parent.frames&&parent.frames.galaxy_main;if("galaxy_main"==a.attr("target")&&!b){var c=a.attr("href");c+=-1==c.indexOf("?")?"?":"&",c+="use_panels=True",a.attr("href",c),a.attr("target","_self")}return a});try{if(et=JSON.parse(sessionStorage.getItem("activeGalaxyTour")),et&&(et=TOURS.hooked_tour_from_data(et),et&&et.steps)){console.log("Resuming existing tour: "+et.name);var b=new Tour({storage:window.sessionStorage,steps:et.steps,debug:!0,onEnd:function(){sessionStorage.removeItem("activeGalaxyTour")}});b.init(),b.restart()}}catch(c){console.log("Tour loading failure, you'll need to restart the tour manually."+c)}});
//# sourceMappingURL=../maps/onload.js.map