Kawai Wiki

Rev

Rev 71 | Rev 73 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 71 Rev 72
Line 107... Line 107...
107
        
107
        
108
        function showEditPageDialog(pageName, lang) {
108
        function showEditPageDialog(pageName, lang) {
109
109
110
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
110
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
111
111
-
 
112
                if (data.page.systemPage) {
-
 
113
                	$('.editPageTitleCell').hide();
-
 
114
                } else {
-
 
115
                	$('.editPageTitleCell').show();
-
 
116
                	$('#editPageTitle').val(data.page.title);
-
 
117
                }
112
                $('#editPageTextArea').val(data.page.body);
118
                $('#editPageTextArea').val(data.page.body);
113
                $('#editPageName').val(data.page.name);
119
                $('#editPageName').val(data.page.name);
114
                $('#editPageLang').val(data.page.lang);
120
                $('#editPageLang').val(data.page.lang);
115
121
116
                myDialog = $('#editPageDialog');
122
                myDialog = $('#editPageDialog');
Line 123... Line 129...
123
        
129
        
124
        function showEditPreviewDialog(pageName, lang) {
130
        function showEditPreviewDialog(pageName, lang) {
125
131
126
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
132
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
127
133
-
 
134
            	if (data.page.systemPage) {
-
 
135
                	$('.editPageTitleCell').hide();
-
 
136
                } else {
-
 
137
                	$('.editPageTitleCell').show();
-
 
138
                	$('#editPageTitle').val(data.page.title);
-
 
139
                }
128
                $('#editPageTextArea').val(data.page.body);
140
                $('#editPageTextArea').val(data.page.body);
129
                $('#editPageName').val(data.page.name);
141
                $('#editPageName').val(data.page.name);
130
                $('#editPageLang').val(data.page.lang);
142
                $('#editPageLang').val(data.page.lang);
131
143
132
                myDialog = $('#editPageDialog');
144
                myDialog = $('#editPageDialog');
Line 148... Line 160...
148
        		$('#createNewPageTextArea').val(data.page.body);
160
        		$('#createNewPageTextArea').val(data.page.body);
149
        		$('#createNewPageNameError').text('');
161
        		$('#createNewPageNameError').text('');
150
        		$('#createNewPageTitleError').text('');
162
        		$('#createNewPageTitleError').text('');
151
        		$('#createNewPageLanguageError').text('');
163
        		$('#createNewPageLanguageError').text('');
152
        		$('#createNewPageBodyError').text('');
164
        		$('#createNewPageBodyError').text('');
153
        		$('#createPageLanguageCell').hide();
-
 
154
            
165
            
155
				showCreateNewPageDialog();
166
				showCreateNewPageDialog();
-
 
167
-
 
168
				$('#createPageLanguageCell').hide();
156
            });
169
            });
157
            
170
            
158
            return false;
171
            return false;
159
        }
172
        }
160
        
173
        
Line 236... Line 249...
236
        
249
        
237
       	function showCreateNewPageDialog() {
250
       	function showCreateNewPageDialog() {
238
251
239
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
252
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
240
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
253
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
-
 
254
            $('#createPageLanguageCell').show();
241
255
242
            myDialog = $('#createNewPageDialog');
256
            myDialog = $('#createNewPageDialog');
243
            myDialog = prepareCreateNewPageDialog(myDialog);
257
            myDialog = prepareCreateNewPageDialog(myDialog);
244
            myDialog.dialog('open');
258
            myDialog.dialog('open');
245
            
259
            
Line 386... Line 400...
386
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
400
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
387
<table>
401
<table>
388
    <tr>
402
    <tr>
389
        <td>&nbsp;</td>
403
        <td>&nbsp;</td>
390
    </tr>
404
    </tr>
391
    <mtw:outError field="html">
-
 
392
        <tr>
-
 
393
            <td colspan="2"><span class="Negative" style="font-weight: bold;"><mtw:out /></span></td>
-
 
394
        </tr>
-
 
395
    </mtw:outError>
-
 
-
 
405
                <tr class="editPageTitleCell">
-
 
406
                    <td>
-
 
407
                        Title:
-
 
408
                    </td>
-
 
409
                    <td>
-
 
410
                        <mtw:input id="editPageTitle" name="title" size="40" maxlength="60" />
-
 
411
                        <span id="editPageTitleError">
-
 
412
                        <mtw:outError field="title">
-
 
413
                            <font color="red">
-
 
414
                                <b><mtw:out /></b>
-
 
415
                            </font>
-
 
416
                        </mtw:outError>
-
 
417
                        </span>
-
 
418
                    </td>
-
 
419
                </tr>
-
 
420
                <tr class="editPageTitleCell"><td>&nbsp;</td></tr>
396
    <tr>
421
    <tr>
397
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" /></td>
-
 
-
 
422
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" />
-
 
423
        <span id="editPageTextAreaError">
-
 
424
                        <mtw:outError field="body">
-
 
425
                            <font color="red">
-
 
426
                                <b><mtw:out /></b>
-
 
427
                            </font>
-
 
428
                        </mtw:outError>
-
 
429
                        </span>
-
 
430
        
-
 
431
        </td>
398
    </tr>
432
    </tr>
399
</table>
433
</table>
400
</form>
434
</form>
401
</div>
435
</div>
402
436