Changes between Initial Version and Version 1 of Ticket #15332


Ignore:
Timestamp:
May 11, 2012, 9:26:00 AM (8 years ago)
Author:
bill
Comment:

Don't modify the code, just do a build. Builds inline dojo/text! dependencies. This is the standard procedure to resolve this issue, not just for the table plugins, but for everything in dojo that uses dojo/text!, including all the widgets.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15332

    • Property Status changed from new to closed
    • Property Resolution changed from to wontfix
  • Ticket #15332 – Description

    initial v1  
    1 The templates used by the table plugin for dijit.Editor are loaded using Ajax. This fails when using dojo from file://. If the plugin modified the templates for insertTable and modifyTable to set those as "hardcoded strings" instead of separate html documents, this cures the problem. This enables use of this plugin without modifying the code for e.g. Cordova/PhoneGap projects.
    2 
    3 For "dojox.editor.plugins.EditorModifyTableDialog" and "dojox.editor.plugins.EditorModifyTableDialog", change
    4 the templateString's to something like:
    5 
    6 modifyTableTemplate=[
    7   '<div class="dijitDialog" tabindex="-1" role="dialog" aria-labelledby="${id}_title">',
    8   '<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">',
    9   '<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title">${modifyTableTitle}</span>',
    10   '<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">',
    11   '  <span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>',
    12   '</span>',
    13   '</div>',
    14     '<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">',
    15         '<table class="etdTable">',
    16           '<tr><td>',
    17                 '<label>${backgroundColor}</label>',
    18             '</td><td colspan="2">',
    19                 '<span class="colorSwatchBtn" dojoAttachPoint="backgroundCol"></span>',
    20             '</td></tr><tr><td>',
    21                 '<label>${borderColor}</label>',
    22             '</td><td colspan="2">',
    23                 '<span class="colorSwatchBtn" dojoAttachPoint="borderCol"></span>',
    24             '</td></tr><tr><td>',
    25                 '<label>${align}</label>',
    26             '</td><td colspan="2">',
    27                 '<select dojoAttachPoint="selectAlign" dojoType="dijit.form.FilteringSelect">',
    28                   '<option value="default">${default}</option>',
    29                   '<option value="left">${left}</option>',
    30                   '<option value="center">${center}</option>',
    31                   '<option value="right">${right}</option>',
    32                 '</select>',
    33             '</td></tr>',
    34             '<tr><td>',
    35                 '<label>${tableWidth}</label>',
    36             '</td><td>',
    37                 '<span dojoAttachPoint="selectWidth" dojoType="dijit.form.TextBox" value="100"></span>',
    38             '</td><td>',
    39                 '<select dojoAttachPoint="selectWidthType" hasDownArrow="true" dojoType="dijit.form.FilteringSelect">',
    40                   '<option value="percent">${percent}</option>',
    41                   '<option value="pixels">${pixels}</option>',
    42                 '</select></td></tr> ',
    43             '<tr><td>',
    44                 '<label>${borderThickness}</label></td>',
    45             '</td><td>',
    46                 '<span dojoAttachPoint="selectBorder" dojoType="dijit.form.TextBox" value="1"></span>',
    47             '</td><td>',
    48                 '${pixels}',
    49             '</td></tr><tr><td>',
    50                 '<label>${cellPadding}</label></td>',
    51             '</td><td>',
    52                 '<span dojoAttachPoint="selectPad" dojoType="dijit.form.TextBox" value="0"></span>',
    53             '</td><td class="cellpad"></td></tr><tr><td>',
    54                 '<label>${cellSpacing}</label>',
    55             '</td><td>',
    56                 '<span dojoAttachPoint="selectSpace" dojoType="dijit.form.TextBox" value="0"></span>',
    57             '</td><td class="cellspace"></td></tr>',
    58         '</table>',
    59         '<div class="dialogButtonContainer">',
    60             '<div dojoType="dijit.form.Button" dojoAttachEvent="onClick: onSet">${buttonSet}</div>',
    61             '<div dojoType="dijit.form.Button" dojoAttachEvent="onClick: onCancel">${buttonCancel}</div>',
    62         '</div>',
    63   '</div>',
    64   '</div>'].join('\n'),
    65 
    66 ----- and -----
    67 
    68 insertTableTemplate=[
    69   '<div class="dijitDialog" tabindex="-1" role="dialog" aria-labelledby="${id}_title">',
    70     '<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">',
    71     '<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title">${insertTableTitle}</span>',
    72     '<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">',
    73       '<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>',
    74     '</span>',
    75     '</div>',
    76       '<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">',
    77           '<table class="etdTable"><tr>',
    78               '<td>',
    79                   '<label>${rows}</label>',
    80         '</td><td>',
    81                   '<span dojoAttachPoint="selectRow" dojoType="dijit.form.TextBox" value="2"></span>',
    82               '</td><td><table><tr><td class="inner">',
    83                   '<label>${columns}</label>',
    84         '</td><td class="inner">',
    85                   '<span dojoAttachPoint="selectCol" dojoType="dijit.form.TextBox" value="2"></span>',
    86               '</td></tr></table></td></tr>',
    87         '<tr><td>',
    88                   '<label>${tableWidth}</label>',
    89               '</td><td>',
    90                   '<span dojoAttachPoint="selectWidth" dojoType="dijit.form.TextBox" value="100"></span>',
    91         '</td><td>',
    92                   '<select dojoAttachPoint="selectWidthType" hasDownArrow="true" dojoType="dijit.form.FilteringSelect">',
    93                     '<option value="percent">${percent}</option>',
    94                     '<option value="pixels">${pixels}</option>',
    95                   '</select></td></tr>',
    96               '<tr><td>',
    97                   '<label>${borderThickness}</label></td>',
    98               '</td><td>',
    99                   '<span dojoAttachPoint="selectBorder" dojoType="dijit.form.TextBox" value="1"></span>',
    100               '</td><td>',
    101                   '${pixels}',
    102               '</td></tr><tr><td>',
    103                   '<label>${cellPadding}</label></td>',
    104               '</td><td>',
    105                   '<span dojoAttachPoint="selectPad" dojoType="dijit.form.TextBox" value="0"></span>',
    106               '</td><td class="cellpad"></td></tr><tr><td>',
    107                   '<label>${cellSpacing}</label>',
    108               '</td><td>',
    109                   '<span dojoAttachPoint="selectSpace" dojoType="dijit.form.TextBox" value="0"></span>',
    110               '</td><td class="cellspace"></td></tr></table>',
    111           '<div class="dialogButtonContainer">',
    112               '<div dojoType="dijit.form.Button" dojoAttachEvent="onClick: onInsert">${buttonInsert}</div>',
    113               '<div dojoType="dijit.form.Button" dojoAttachEvent="onClick: onCancel">${buttonCancel}</div>',
    114           '</div>',
    115     '</div>',
    116   '</div>'].join('\n');
     1The templates used by the table plugin for dijit.Editor are loaded using Ajax. This fails when using dojo from file://.   If the plugin modified the templates for insertTable and modifyTable to set those as "hardcoded strings" instead of separate html documents, this cures the problem. This enables use of this plugin without modifying the code for e.g. Cordova/PhoneGap projects.