Changeset 2566:9bf417837888 for plugins/blowupConfig/config.js
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blowupConfig/config.js
r2358 r2566 8 8 toggleDisable($('#blog_title_p')); 9 9 } 10 10 11 11 $('#blog_title_hide').click(function() { 12 12 toggleDisable($('#blog_title_f')); … … 16 16 toggleDisable($('#blog_title_p')); 17 17 }); 18 18 19 19 // Upload form 20 20 if ($('#top_image').val() == 'custom') { … … 23 23 $('#uploader').hide(); 24 24 } 25 25 26 26 $('#top_image').change(function() { 27 27 if (this.value == 'custom') { … … 34 34 } 35 35 }); 36 36 37 37 // Predefined styles 38 38 var styles_combo = document.createElement('select'); … … 40 40 $(styles_combo).append('<option value="none">none</option>'); 41 41 $(styles_combo).attr('title',dotclear.msg.predefined_style_title); 42 42 43 43 for (var style in dotclear.blowup_styles) { 44 44 styles_option = document.createElement('option'); … … 47 47 $(styles_combo).append(styles_option); 48 48 } 49 49 50 50 $('#theme_config').prepend(styles_combo); 51 51 $(styles_combo).wrap('<div class="fieldset"></div>').before('<h3>' + dotclear.msg.predefined_styles + '</h3>').wrap('<p></p>'); 52 52 53 53 $(styles_combo).change(function() { 54 54 $(this.form).find('input[type=text]').val('').css({backgroundColor: '#FFF', color: '#000'}); … … 60 60 } 61 61 }); 62 62 63 63 // Code import 64 64 var e = $('#bu_export_content'); 65 65 e.toggle(); 66 66 67 67 var img = document.createElement('img'); 68 68 img.src = dotclear.img_plus_src; … … 72 72 $(document.createTextNode(' ')).prependTo('#bu_export'); 73 73 $(img).prependTo('#bu_export'); 74 74 75 75 $(img).click(function() { 76 76 if (e.css('display') == 'none') { … … 83 83 e.toggle(); 84 84 }); 85 85 86 86 var a = document.createElement('a'); 87 87 a.href = '#'; 88 88 $(a).text(dotclear.msg.apply_code); 89 89 90 90 e.append(a); 91 91 92 92 $(a).click(function() { 93 93 var code = e.find('#export_code'); 94 94 if (code.size() == 0) { return false; } 95 95 96 96 applyBlowupValues(code.val()); 97 97 return false; 98 98 }); 99 99 100 100 function toggleDisable(e) { 101 101 if (e.attr('disabled')) { … … 105 105 } 106 106 } 107 107 108 108 function applyBlowupValues(code) { 109 109 code = code.replace("\n",""); … … 111 111 var reg = /^(.+):"([^"]*)"(;?)\s*$/; 112 112 var s = code.match(re); 113 113 114 114 if (typeof(s) == 'object' && s.length > 0) { 115 115 var member, target, value, t_e; … … 122 122 } 123 123 } 124 124 125 125 function updateValueField(e,v) { 126 126 e.val(v); … … 132 132 } 133 133 } 134 134 135 135 function getColorLum(color) 136 136 { … … 138 138 parseInt('0x' + color.substring(3, 5)) / 255, 139 139 parseInt('0x' + color.substring(5, 7)) / 255]; 140 140 141 141 return (Math.min(rgb[0], Math.min(rgb[1], rgb[2])) + Math.max(rgb[0], Math.max(rgb[1], rgb[2]))) / 2; 142 142 }
Note: See TracChangeset
for help on using the changeset viewer.