Revision 2679:bae19d3adbc4,
1.0 KB
checked in by Nicolas <nikrou77@…>, 11 years ago
(diff) |
Addresses #1896 : add choice of editor in preferences
Keeps old functions in core addFormater(), callFormater() for compatibility.
|
Line | |
---|
1 | $(function() { |
---|
2 | if ($('#new_pwd').length == 0) { |
---|
3 | return; |
---|
4 | } |
---|
5 | |
---|
6 | var user_email = $('#user_email').val(); |
---|
7 | |
---|
8 | $('#user-form').submit(function() { |
---|
9 | var e = this.elements['cur_pwd']; |
---|
10 | if (e.value != '') { |
---|
11 | return true; |
---|
12 | } |
---|
13 | if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') { |
---|
14 | e.focus(); |
---|
15 | $(e).backgroundFade({sColor: dotclear.fadeColor.beginUserMail, eColor: dotclear.fadeColor.endUserMail, steps: 50},function() { |
---|
16 | $(this).backgroundFade({sColor: dotclear.fadeColor.endUserMail, eColor: dotclear.fadeColor.beginUserMail}); |
---|
17 | }); |
---|
18 | return false; |
---|
19 | } |
---|
20 | return true; |
---|
21 | }); |
---|
22 | |
---|
23 | // choose format depending of editor based on formats_by_editor defined in preferences.php |
---|
24 | if (formats_by_editor !== undefined) { |
---|
25 | var _editors = $.parseJSON(formats_by_editor); |
---|
26 | |
---|
27 | $('#user_editor').change(function() { |
---|
28 | if (!_editors[$(this).val()]) {return;} |
---|
29 | |
---|
30 | $('#user_post_format option').remove(); |
---|
31 | for (var format in _editors[$(this).val()]) { |
---|
32 | $('#user_post_format').append('<option value="'+format+'">'+format+'</option>'); |
---|
33 | } |
---|
34 | }); |
---|
35 | } |
---|
36 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.