Changeset 3880:e6d1f6d9d7df for plugins/blowupConfig
- Timestamp:
- 09/18/18 20:22:10 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blowupConfig/js/config.js
r3768 r3880 39 39 40 40 // Predefined styles 41 varstyles_combo = document.createElement('select');41 const styles_combo = document.createElement('select'); 42 42 $(styles_combo).append('<option value=""> </option>'); 43 43 $(styles_combo).append('<option value="none">none</option>'); 44 44 $(styles_combo).attr('title', dotclear.msg.predefined_style_title); 45 45 46 for ( varstyle in dotclear.blowup_styles) {47 varstyles_option = document.createElement('option');46 for (let style in dotclear.blowup_styles) { 47 const styles_option = document.createElement('option'); 48 48 styles_option.value = dotclear.blowup_styles[style]; 49 49 $(styles_option).append(style); … … 68 68 69 69 // Code import 70 vare = $('#bu_export_content');70 const e = $('#bu_export_content'); 71 71 72 $('#bu_export').toggleWithLegend($(e), {73 74 }) 72 $('#bu_export').toggleWithLegend($(e), { 73 legend_click: true 74 }); 75 75 76 vara = document.createElement('a');76 const a = document.createElement('a'); 77 77 a.href = '#'; 78 78 $(a).text(dotclear.msg.apply_code); … … 81 81 82 82 $(a).click(function() { 83 varcode = e.find('#export_code');83 const code = e.find('#export_code'); 84 84 if (code.size() == 0) { 85 85 return false; … … 100 100 function applyBlowupValues(code) { 101 101 code = code.replace('\n', ''); 102 varre = /(^| )([a-zA-Z0-9_]+):"([^"]*?)"(;|$)/g;103 varreg = /^(.+):"([^"]*)"(;?)\s*$/;104 vars = code.match(re);102 const re = /(^| )([a-zA-Z0-9_]+):"([^"]*?)"(;|$)/g; 103 const reg = /^(.+):"([^"]*)"(;?)\s*$/; 104 const s = code.match(re); 105 105 106 106 if (typeof(s) == 'object' && s.length > 0) { 107 var member, target, value; 108 for (var i = 0, s_length = s.length; i < s_length; i++) { 107 let member; 108 let target; 109 let value; 110 for (let i = 0, s_length = s.length; i < s_length; i++) { 109 111 member = reg.exec(s[i]); 110 112 target = member[1].replace(' ', ''); … … 126 128 127 129 function getColorLum(color) { 128 varrgb = [parseInt('0x' + color.substring(1, 3)) / 255,130 const rgb = [parseInt('0x' + color.substring(1, 3)) / 255, 129 131 parseInt('0x' + color.substring(3, 5)) / 255, 130 132 parseInt('0x' + color.substring(5, 7)) / 255
Note: See TracChangeset
for help on using the changeset viewer.