~ubuntu-branches/debian/sid/wordpress/sid

« back to all changes in this revision

Viewing changes to wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2013-09-04 23:18:58 UTC
  • mfrom: (1.2.28)
  • Revision ID: package-import@ubuntu.com-20130904231858-nljmn1buzswh63jk
Tags: 3.6+dfsg-1
* New upstream release.
* Improve wp-settings to verify that $_SERVER['HTTP_X_FORWARDED_PROTO']
  exists before accessing it (avoids a PHP notice).
  Thanks to Paul Dreik <slask@pauldreik.se> for the report and the patch.
* Document in README.Debian the need to login to /wp-admin/ to complete
  an upgrade.
* Drop useless debian/README.source
* Drop 008CVE2008-2392.patch since upstream now disables unfiltered
  uploads by default. See http://core.trac.wordpress.org/ticket/10692
* Drop 009CVE2008-6767.patch since the backto parameter is validated
  against a whitelist, and externally triggered upgrades are not a
  security problem as long as they work.
* Update debian/missing-sources with latest versions.
* Update upstream l10n.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
        tinymce.create('tinymce.plugins.WordPress', {
9
9
                init : function(ed, url) {
10
 
                        var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key;
11
 
                        moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
12
 
                        nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
 
10
                        var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style;
 
11
                        moreHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
 
12
                        nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
13
13
 
14
14
                        if ( getUserSetting('hidetb', '0') == '1' )
15
15
                                ed.settings.wordpress_adv_hidden = 0;
133
133
                                                }
134
134
                                        }
135
135
                                }
 
136
 
 
137
                                if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) {
 
138
                                        if ( !style )
 
139
                                                style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
 
140
 
 
141
                                        ed.getDoc().head.appendChild( style );
 
142
                                }
 
143
                        });
 
144
 
 
145
                        ed.onExecCommand.add( function( ed, cmd, ui, val ) {
 
146
                                if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
 
147
                                        ed.dom.remove( style );
136
148
                        });
137
149
 
138
150
                        ed.onInit.add(function(ed) {
217
229
                        });
218
230
 
219
231
                        ed.onSaveContent.add(function(ed, o) {
220
 
                                if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' ) {
221
 
                                        if ( ed.isHidden() )
222
 
                                                o.content = o.element.value;
223
 
                                        else
224
 
                                                o.content = switchEditors.pre_wpautop(o.content);
225
 
                                }
 
232
                                // If editor is hidden, we just want the textarea's value to be saved
 
233
                                if ( ed.isHidden() )
 
234
                                        o.content = o.element.value;
 
235
                                else if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' )
 
236
                                        o.content = switchEditors.pre_wpautop(o.content);
226
237
                        });
227
238
 
228
239
                        /* disable for now
372
383
                _handleMoreBreak : function(ed, url) {
373
384
                        var moreHTML, nextpageHTML;
374
385
 
375
 
                        moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
376
 
                        nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
 
386
                        moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
 
387
                        nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
377
388
 
378
389
                        // Display morebreak instead if img in element path
379
390
                        ed.onPostRender.add(function() {
380
391
                                if (ed.theme.onResolveName) {
381
392
                                        ed.theme.onResolveName.add(function(th, o) {
382
393
                                                if (o.node.nodeName == 'IMG') {
383
 
                                                        if ( ed.dom.hasClass(o.node, 'mceWPmore') )
 
394
                                                        if ( ed.dom.hasClass(o.node, 'mce-wp-more') )
384
395
                                                                o.name = 'wpmore';
385
 
                                                        if ( ed.dom.hasClass(o.node, 'mceWPnextpage') )
 
396
                                                        if ( ed.dom.hasClass(o.node, 'mce-wp-nextpage') )
386
397
                                                                o.name = 'wppage';
387
398
                                                }
388
399
 
402
413
                        ed.onPostProcess.add(function(ed, o) {
403
414
                                if (o.get)
404
415
                                        o.content = o.content.replace(/<img[^>]+>/g, function(im) {
405
 
                                                if (im.indexOf('class="mceWPmore') !== -1) {
 
416
                                                if (im.indexOf('class="mce-wp-more') !== -1) {
406
417
                                                        var m, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : '';
407
418
                                                        im = '<!--more'+moretext+'-->';
408
419
                                                }
409
 
                                                if (im.indexOf('class="mceWPnextpage') !== -1)
 
420
                                                if (im.indexOf('class="mce-wp-nextpage') !== -1)
410
421
                                                        im = '<!--nextpage-->';
411
422
 
412
423
                                                return im;
415
426
 
416
427
                        // Set active buttons if user selected pagebreak or more break
417
428
                        ed.onNodeChange.add(function(ed, cm, n) {
418
 
                                cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPnextpage'));
419
 
                                cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPmore'));
 
429
                                cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-nextpage'));
 
430
                                cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-more'));
420
431
                        });
421
432
                }
422
433
        });