-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07d2000
commit 460a899
Showing
8 changed files
with
354 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
<div class="row mt5"> | ||
<div class="col-xs-12 text-center"> | ||
<h3><%- i18next.t("You're using open source Community Edition. Please consider upgrading to the Enterprise Edition and support this open source project") %></h3> | ||
</div> | ||
<div class="col-xs-12 text-center"> | ||
<a href="http://restya.com/enterprise?utm_source=Restyaboard - <%- SITE_NAME %>&utm_medium=web&utm_campaign=contact&category=contact" target="_blank" title="<%- i18next.t('Upgrade to Enterprise Edition') %>" class="btn btn-primary navbar-btn"><%- i18next.t('Upgrade') %></a> | ||
</div> | ||
</div> |
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,180 @@ | ||
/** | ||
* popup View | ||
* @class popupView | ||
* @constructor | ||
* @extends Backbone.View | ||
*/ | ||
|
||
App.popupView = Backbone.View.extend({ | ||
/** | ||
* Constructor | ||
* initialize default values and actions | ||
*/ | ||
initialize: function() { | ||
if (window.location.hash === "#/boards") { | ||
this.render(); | ||
} | ||
}, | ||
template: JST['templates/popup'], | ||
/** | ||
* render() | ||
* populate the html to the dom | ||
* @param NULL | ||
* @return object | ||
* | ||
*/ | ||
render: function() { | ||
var communityEditionPopup = JSON.parse(authuser.user.community_edition_popup); | ||
var expirationDate = communityEditionPopup.date.replace('T', ' '); | ||
expirationDate = new Date(expirationDate); | ||
expirationDate.setDate(expirationDate.getDate() + parseInt(30)); | ||
var currentDate = new Date('2021-08-01 16:56:23'); | ||
if ((currentDate.getTime() > expirationDate.getTime()) && !communityEditionPopup.is_skipped) { | ||
this.$el.dockmodal({ | ||
height: 300, | ||
width: 200, | ||
animationSpeed: ANIMATION_SPEED, | ||
title: "<div class='col-xs-12'><div class='text-center'><strong>" + i18next.t('Upgrade to Enterprise Edition') + "</strong></div></div>", | ||
beforePopout: function(event) { | ||
if ($(window).width() < 1400) { | ||
$('.editor').resizable({ | ||
maxWidth: 1000, | ||
minWidth: 500 | ||
}); | ||
} else { | ||
$('.editor').resizable({ | ||
maxWidth: 1050, | ||
minWidth: 500 | ||
}); | ||
} | ||
$('.editor').each(function() { | ||
var $this = $(this); | ||
var factor1 = '30', | ||
factor2 = '70'; | ||
if (!_.isUndefined(authuser.user) && !_.isEmpty(authuser.user)) { | ||
if (!_.isUndefined(authuser.user.persist_card_divider_position) && authuser.user.persist_card_divider_position !== null) { | ||
factor1 = authuser.user.persist_card_divider_position; | ||
factor2 = 100 - factor1; | ||
} | ||
} | ||
$this.resizable({ | ||
handles: 'e', | ||
resize: function(event, ui) { | ||
var x = ui.element.outerWidth(); | ||
var ele = ui.element; | ||
var factor = x * 100 / $(this).parent().width(); | ||
var f1 = factor; | ||
var f2 = 100 - factor; | ||
$.cookie('factor1', f1); | ||
$this.css('width', f1 + '%'); | ||
$this.next().css('width', f2 + '%'); | ||
}, | ||
stop: function(event, ui) { | ||
var x = ui.element.outerWidth(); | ||
var factor = x * 100 / $(this).parent().width(); | ||
if (!_.isUndefined(authuser.user) && !_.isEmpty(authuser.user)) { | ||
var data = { | ||
persist_card_divider_position: factor | ||
}; | ||
var user = new App.User(); | ||
user.url = api_url + 'users/' + authuser.user.id + '.json'; | ||
user.set('id', parseInt(authuser.user.id)); | ||
user.save(data, { | ||
success: function(model, response) { | ||
var Auth = JSON.parse($.cookie('auth')); | ||
Auth.user.persist_card_divider_position = factor; | ||
$.cookie('auth', JSON.stringify(Auth)); | ||
authuser = Auth; | ||
} | ||
}); | ||
} | ||
}, | ||
}).css({ | ||
width: factor1 + '%' | ||
}).next().css({ | ||
width: factor2 + '%' | ||
}); | ||
}); | ||
}, | ||
beforeRestore: function(event) { | ||
$('.editor').resizable({ | ||
maxWidth: 380, | ||
minWidth: 350 | ||
}); | ||
$('.editor').each(function() { | ||
var $this = $(this); | ||
var factor1 = '60'; | ||
var factor2 = '40'; | ||
$this.resizable({ | ||
handles: 'e', | ||
resize: function(event, ui) { | ||
var x = ui.element.outerWidth(); | ||
var ele = ui.element; | ||
var factor = x * 100 / $(this).parent().width(); | ||
var f1 = factor; | ||
var f2 = 100 - factor; | ||
$this.css('width', f1 + '%'); | ||
$this.next().css('width', f2 + '%'); | ||
} | ||
}).css({ | ||
width: factor1 + '%' | ||
}).next().css({ | ||
width: factor2 + '%' | ||
}); | ||
}); | ||
}, | ||
open: function(event, dialog) { | ||
$('.dockmodal').removeClass('active'); | ||
event.parent().parent().addClass('active'); | ||
$('.dockmodal').click(function(e) { | ||
$('.dockmodal').removeClass('active'); | ||
$(this).addClass('active'); | ||
}); | ||
$(window).bind('keydown', function(e) { | ||
if (e.keyCode === 27) { | ||
$('.action-close', $('.dockmodal.active')).trigger('click'); | ||
} | ||
}); | ||
}, | ||
close: function(event, dialog) { | ||
var data = {}; | ||
data.date = communityEditionPopup.date; | ||
data.is_skipped = true; | ||
var formdata = {}; | ||
formdata.community_edition_popup = JSON.stringify(data); | ||
var user = new App.User(); | ||
user.url = api_url + 'users/' + authuser.user.id + '.json'; | ||
user.save(formdata, { | ||
success: function(response) { | ||
if (!_.isEmpty(response.attributes.success)) { | ||
var Auth = JSON.parse($.cookie('auth')); | ||
Auth.user.community_edition_popup = JSON.stringify(data); | ||
$.cookie('auth', JSON.stringify(Auth)); | ||
authuser = Auth; | ||
} | ||
} | ||
}); | ||
/* var data = {}; | ||
data.is_intro_video_skipped = true; | ||
$('.action-close', ('.dockmodal-header')).trigger('click'); | ||
var introvideo = new App.intro_view_model(); | ||
introvideo.url = api_url + 'users/' + authuser.user.id + '.json'; | ||
introvideo.save(data, { | ||
success: function(response) { | ||
if (!_.isEmpty(response.attributes.success)) { | ||
var Auth = JSON.parse($.cookie('auth')); | ||
Auth.user.is_intro_video_skipped = response.attributes.is_intro_video_skipped; | ||
$.cookie('auth', JSON.stringify(Auth)); | ||
authuser = Auth; | ||
} | ||
} | ||
}); */ | ||
} | ||
}); | ||
this.$el.html(this.template); | ||
} | ||
return this; | ||
} | ||
}); |
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
Oops, something went wrong.