View | Details | Raw Unified | Return to bug 17179
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js (-2 / +45 lines)
Lines 151-156 define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], Link Here
151
        'Ctrl-X': function( cm ) {
151
        'Ctrl-X': function( cm ) {
152
            // Delete line (or cut)
152
            // Delete line (or cut)
153
            if ( cm.somethingSelected() ) return true;
153
            if ( cm.somethingSelected() ) return true;
154
            var curLine = cm.getLine( cm.getCursor().line );
155
            $("#clipboard").prepend('<option>'+curLine+'</option>');
154
156
155
            cm.execCommand('deleteLine');
157
            cm.execCommand('deleteLine');
156
        },
158
        },
Lines 160-167 define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], Link Here
160
            var field = cm.marceditor.getCurrentField();
162
            var field = cm.marceditor.getCurrentField();
161
            if ( !field ) return;
163
            if ( !field ) return;
162
164
163
            var subfield = field.getSubfieldAt( cm.getCursor().ch );
165
            var curCursor = cm.getCursor();
164
            if ( subfield ) subfield.delete();
166
            var subfield = field.getSubfieldAt( curCursor.ch );
167
            var subfieldText = cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end});
168
            if ( subfield ) {
169
                $("#clipboard").prepend('<option>'+subfieldText+'</option>');
170
                subfield.delete();
171
            }
172
        },
173
174
        'Ctrl-C': function( cm ) {
175
            // Copy line
176
            if ( cm.somethingSelected() ) return true;
177
            var curLine = cm.getLine( cm.getCursor().line );
178
            $("#clipboard").prepend('<option>'+curLine+'</option>');
179
        },
180
181
        'Shift-Ctrl-C': function( cm ) {
182
            // Copy subfield
183
            var field = cm.marceditor.getCurrentField();
184
            if ( !field ) return;
185
186
            var curCursor = cm.getCursor();
187
            var subfield = field.getSubfieldAt( curCursor.ch );
188
            var subfieldText = cm.getRange({line:curCursor.line,ch:subfield.start},{line:curCursor.line,ch:subfield.end});
189
            if ( subfield ) {
190
                $("#clipboard").prepend('<option>'+subfieldText+'</option>');
191
            }
192
        },
193
194
        'Ctrl-P': function( cm ) {
195
            // Paste line from "clipboard"
196
            if ( cm.somethingSelected() ) return true;
197
            var cBoard = document.getElementById("clipboard");
198
            var strUser = cBoard.options[cBoard.selectedIndex].text;
199
            cm.replaceRange( strUser, cm.getCursor(), null );
200
        },
201
202
        'Ctrl-I': function( cm ) {
203
            // Copy line and insert below
204
            if ( cm.somethingSelected() ) return true;
205
            var curLine = cm.getLine( cm.getCursor().line );
206
            cm.execCommand('newlineAndIndent');
207
            cm.replaceRange( curLine, cm.getCursor(), null );
165
        },
208
        },
166
209
167
        Tab: function( cm ) {
210
        Tab: function( cm ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt (-1 / +30 lines)
Lines 92-97 Link Here
92
    </fieldset>
92
    </fieldset>
93
</form>
93
</form>
94
94
95
<h3>Clipboard</h3>
96
<fieldset class="brief">
97
<select id="clipboard" name="clipboard" size=10>
98
</select>
99
</fieldset>
100
95
</div>
101
</div>
96
102
97
</div>
103
</div>
Lines 273-278 Link Here
273
            <td>Save record</td>
279
            <td>Save record</td>
274
        </tr>
280
        </tr>
275
        <tr>
281
        <tr>
282
            <td>Ctrl-C</td>
283
            <td>Copy current field</td>
284
        </tr>
285
        <tr>
286
            <td>Ctrl-Shift-C</td>
287
            <td>Copy current subfield</td>
288
        </tr>
289
        <tr>
290
            <td>Ctrl-P</td>
291
            <td>Paste selection from "clipboard"</td>
292
        </tr>
293
        <tr>
294
            <td>Ctrl-V</td>
295
            <td>Paste from system clipboard</td>
296
        </tr>
297
        <tr>
276
            <td>Ctrl-X</td>
298
            <td>Ctrl-X</td>
277
            <td>Delete current field</td>
299
            <td>Delete current field</td>
278
        </tr>
300
        </tr>
Lines 281-286 Link Here
281
            <td>Delete current subfield</td>
303
            <td>Delete current subfield</td>
282
        </tr>
304
        </tr>
283
        <tr>
305
        <tr>
306
            <td>Ctrl-I</td>
307
            <td>Copy current field on next line</td>
308
        </tr>
309
        <tr>
284
            <td>Enter</td>
310
            <td>Enter</td>
285
            <td>New field on next line</td>
311
            <td>New field on next line</td>
286
        </tr>
312
        </tr>
Lines 296-301 Link Here
296
            <td>Shift-Tab</td>
322
            <td>Shift-Tab</td>
297
            <td>Move to previous position</td>
323
            <td>Move to previous position</td>
298
        </tr>
324
        </tr>
325
        <tr>
326
            <td>Ctrl-Z</td>
327
            <td>Undo previous action</td>
328
        </tr>
299
    </tbody>
329
    </tbody>
300
</table>
330
</table>
301
</div>
331
</div>
302
- 

Return to bug 17179