This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
/
application.js
88 lines (76 loc) · 3.24 KB
/
application.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
// TODO: change css and image to be error-ish
function error_growl_template()
{
jQuery.growl.settings.displayTimeout = 6000;
jQuery.growl.settings.noticeTemplate = ''
+ '<div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; display: block; color: #ffffff; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
+ ' <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
+ ' <h3 style="margin: 0pt; margin-left: 77px; padding-bottom: 10px; font-size: 13px;">%title%</h3>'
+ ' <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
+ '</div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
+ '</div>';
jQuery.growl.settings.noticeCss = {
position: 'relative'
};
}
// TODO: add real image paths..
function notice_growl_template()
{
jQuery.growl.settings.displayTimeout = 4000;
jQuery.growl.settings.noticeTemplate = ''
+ '<div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; display: block; color: #ffffff; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
+ ' <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
+ ' <h3 style="margin: 0pt; margin-left: 77px; padding-bottom: 10px; font-size: 13px;">%title%</h3>'
+ ' <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
+ '</div>'
+ '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
+ '</div>';
jQuery.growl.settings.noticeCss = {
position: 'relative'
};
}
// Trigger a growl alert. Call one of the above template methods if you want to
function notify(message, title)
{
jQuery.growl(title || 'Notice', message || '');
jQuery.growl.settings = $default_growl_settings;
}
jQuery(document).ready(function()
{
// Prevent the default growl settings from being overwritten. OH NOES A GLOBAL
$default_growl_settings = jQuery.growl.settings;
var jq = jQuery.noConflict();
jq('a.edit_page_plugin', jq('#page_plugins')).click(function()
{
var modal = jq('#modal');
if(modal.html() == "")
{
jq.ajax({
type: 'GET',
url: jq(this).attr('href'),
complete: function(transport)
{
modal.jqm({overlay: 50});
jq('a.jqmClose').click(function(){
jq(this).jqmHide();
return false;
});
modal.jqmHide();
modal.html(transport.responseText)
modal.jqmShow();
}
});
} else {
// Don't load it again
modal.jqmShow();
}
return false
});
});