-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unit tests, add online preview (Fixes #26)
PHPCS clean up.
- Loading branch information
Showing
29 changed files
with
849 additions
and
538 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,70 @@ | ||
(function($){ | ||
/*"use strict";*/ | ||
$.entwine('ss', function($) { | ||
$('#action_doSend').entwine({ | ||
onclick: function(e) { | ||
var message = ss.i18n._t('NEWSLETTER.SENDCONFIRMMESSAGE', | ||
'Are you sure you want to send this newsletter?'); | ||
if (confirm(message)) { | ||
this._super(e); | ||
} else { | ||
e.preventDefault(); | ||
return false; | ||
} | ||
} | ||
}); | ||
(function ($) { | ||
/*"use strict";*/ | ||
$.entwine( | ||
'ss', | ||
function ($) { | ||
$('#action_doSend').entwine( | ||
{ | ||
onclick: function (e) { | ||
var message = ss.i18n._t( | ||
'NEWSLETTER.SENDCONFIRMMESSAGE', | ||
'Are you sure you want to send this newsletter?' | ||
); | ||
if (confirm(message)) { | ||
this._super(e); | ||
} else { | ||
e.preventDefault(); | ||
return false; | ||
} | ||
} | ||
} | ||
); | ||
|
||
$("#Form_ItemEditForm_action_doDelete").entwine({ | ||
onclick: function(e) { | ||
// customise confirm delete messages for clarity | ||
var item = 'record'; | ||
var pageAction = $('#Form_ItemEditForm').attr('action'); | ||
if(pageAction.indexOf('ItemEditForm/field/Recipients/item/') != -1){ | ||
item = 'Recipient'; | ||
}else if(pageAction.indexOf('admin/newsletter/MailingList/EditForm/field/MailingList/') == 0){ | ||
item = 'Mailing List'; | ||
} | ||
var message = ss.i18n._t('NEWSLETTERADMIN.DELETECONFIRMMESSAGE', | ||
'Are you sure you want to delete this '+item+'?'); | ||
|
||
if (confirm(message)) { | ||
this._super(e); | ||
} else { | ||
e.preventDefault(); | ||
return false; | ||
} | ||
} | ||
}); | ||
$("#Form_ItemEditForm_action_doDelete").entwine( | ||
{ | ||
onclick: function (e) { | ||
// customise confirm delete messages for clarity | ||
var item = 'record'; | ||
var pageAction = $('#Form_ItemEditForm').attr('action'); | ||
if (pageAction.indexOf('ItemEditForm/field/Recipients/item/') != -1) { | ||
item = 'Recipient'; | ||
} else if (pageAction.indexOf('admin/newsletter/MailingList/EditForm/field/MailingList/') == 0) { | ||
item = 'Mailing List'; | ||
} | ||
var message = ss.i18n._t( | ||
'NEWSLETTERADMIN.DELETECONFIRMMESSAGE', | ||
'Are you sure you want to delete this '+item+'?' | ||
); | ||
|
||
if (confirm(message)) { | ||
this._super(e); | ||
} else { | ||
e.preventDefault(); | ||
return false; | ||
} | ||
} | ||
} | ||
); | ||
|
||
/** Hide the success message when the other tab is clicked */ | ||
$('.message.good').entwine({ | ||
onmatch: function() { | ||
var self = this; | ||
$('a[href$="Root_SentTo"]').on('click', function(e){ | ||
self.hide(); | ||
}); | ||
} | ||
/** | ||
* Hide the success message when the other tab is clicked | ||
*/ | ||
$('.message.good').entwine( | ||
{ | ||
onmatch: function () { | ||
var self = this; | ||
$('a[href$="Root_SentTo"]').on( | ||
'click', | ||
function (e) { | ||
self.hide(); | ||
} | ||
); | ||
} | ||
|
||
}); | ||
} | ||
); | ||
|
||
}); | ||
} | ||
); | ||
|
||
}(jQuery)); |
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,37 +1,46 @@ | ||
|
||
(function($){ | ||
$.entwine('ss', function($) { | ||
$('table.checkboxsetwithextrafield').entwine({ | ||
UUID: null, | ||
onmatch: function() { | ||
this._super(); | ||
this.tableDnD({ | ||
onDragClass: "DnD_whiledragging", | ||
dragHandle: ".dragHandle", | ||
onDragStart: function(table, row) { | ||
indicator = document.createElement('div'); | ||
$(indicator).html('Moving ...'); | ||
$(row).append($(indicator)); | ||
}, | ||
onDrop:function(table, row){ | ||
jQuery($(row).find(".dragHandle")[0]).empty(); | ||
} | ||
}); | ||
}, | ||
onunmatch: function() { | ||
this._super(); | ||
} | ||
}); | ||
$('table.checkboxsetwithextrafield tbody tr').entwine({ | ||
onmouseover: function() { | ||
jQuery($(this).children(".dragHandle")[0]).addClass('showDragHandle'); | ||
}, | ||
onmouseout: function() { | ||
jQuery($(this).children(".dragHandle")[0]).removeClass('showDragHandle'); | ||
}, | ||
onmouseup: function() { | ||
jQuery($(this).find(".dragHandle")[0]).empty(); | ||
} | ||
}); | ||
}); | ||
(function ($) { | ||
$.entwine( | ||
'ss', | ||
function ($) { | ||
$('table.checkboxsetwithextrafield').entwine( | ||
{ | ||
UUID: null, | ||
onmatch: function () { | ||
this._super(); | ||
this.tableDnD( | ||
{ | ||
onDragClass: "DnD_whiledragging", | ||
dragHandle: ".dragHandle", | ||
onDragStart: function (table, row) { | ||
indicator = document.createElement('div'); | ||
$(indicator).html('Moving ...'); | ||
$(row).append($(indicator)); | ||
}, | ||
onDrop:function (table, row) { | ||
jQuery($(row).find(".dragHandle")[0]).empty(); | ||
} | ||
} | ||
); | ||
}, | ||
onunmatch: function () { | ||
this._super(); | ||
} | ||
} | ||
); | ||
$('table.checkboxsetwithextrafield tbody tr').entwine( | ||
{ | ||
onmouseover: function () { | ||
jQuery($(this).children(".dragHandle")[0]).addClass('showDragHandle'); | ||
}, | ||
onmouseout: function () { | ||
jQuery($(this).children(".dragHandle")[0]).removeClass('showDragHandle'); | ||
}, | ||
onmouseup: function () { | ||
jQuery($(this).find(".dragHandle")[0]).empty(); | ||
} | ||
} | ||
); | ||
} | ||
); | ||
}(jQuery)); |
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,22 +1,26 @@ | ||
(function($){ | ||
"use strict"; | ||
(function ($) { | ||
"use strict"; | ||
|
||
$.entwine('ss', function($) { | ||
$('#Form_ItemEditForm_action_doSendPreview').entwine({ | ||
onclick: function(e) { | ||
var prompt = this.sendPrompt(); | ||
$.entwine( | ||
'ss', | ||
function ($) { | ||
$('#Form_ItemEditForm_action_doSendPreview').entwine( | ||
{ | ||
onclick: function (e) { | ||
var prompt = this.sendPrompt(); | ||
|
||
if (prompt !== null) { | ||
if (prompt !== null) { | ||
} | ||
|
||
} | ||
|
||
return false; | ||
}, | ||
sendPrompt: function() { | ||
var message = 'Send a test email to:'; | ||
return false; | ||
}, | ||
sendPrompt: function () { | ||
var message = 'Send a test email to:'; | ||
|
||
return prompt(message); | ||
} | ||
}); | ||
}); | ||
return prompt(message); | ||
} | ||
} | ||
); | ||
} | ||
); | ||
}(jQuery)); |
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,32 +1,40 @@ | ||
(function($) { | ||
/*"use strict";*/ | ||
(function ($) { | ||
/*"use strict";*/ | ||
|
||
$.entwine('ss', function($) { | ||
$('#SendNotificationControlls ul li').entwine({ | ||
onmatch: function() { | ||
this._super(); | ||
if($('#Form_EditForm_SendNotification').val()==='0'){ | ||
$('.SendNotificationControlledPanel').hide(); | ||
if (this.hasClass('no')) this.addClass('active'); | ||
}else{ | ||
$('.SendNotificationControlledPanel').show(); | ||
if (this.hasClass('yes')) this.addClass('active'); | ||
} | ||
}, | ||
$.entwine( | ||
'ss', | ||
function ($) { | ||
$('#SendNotificationControlls ul li').entwine( | ||
{ | ||
onmatch: function () { | ||
this._super(); | ||
if ($('#Form_EditForm_SendNotification').val()==='0') { | ||
$('.SendNotificationControlledPanel').hide(); | ||
if (this.hasClass('no')) { | ||
this.addClass('active'); | ||
} | ||
} else { | ||
$('.SendNotificationControlledPanel').show(); | ||
if (this.hasClass('yes')) { | ||
this.addClass('active'); | ||
} | ||
} | ||
}, | ||
|
||
onclick: function(e) { | ||
this.addClass('active'); | ||
this.siblings('.active').removeClass('active'); | ||
onclick: function (e) { | ||
this.addClass('active'); | ||
this.siblings('.active').removeClass('active'); | ||
|
||
if(this.hasClass('yes')){ | ||
$('.SendNotificationControlledPanel').show(); | ||
$('#Form_EditForm_SendNotification').val('1'); | ||
|
||
}else{ | ||
$('.SendNotificationControlledPanel').hide(); | ||
$('#Form_EditForm_SendNotification').val('0'); | ||
} | ||
} | ||
}); | ||
}); | ||
if (this.hasClass('yes')) { | ||
$('.SendNotificationControlledPanel').show(); | ||
$('#Form_EditForm_SendNotification').val('1'); | ||
} else { | ||
$('.SendNotificationControlledPanel').hide(); | ||
$('#Form_EditForm_SendNotification').val('0'); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
); | ||
}(jQuery)); |
Oops, something went wrong.