Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 0
Seite [1]
Korrlub


Beginner




Beiträge: 8
# Thema - 25.06.2011 um 10:47 Uhr
Hi,
da ich nichts gefunden hab, hab ich mir mal des Pagebreakplugin dazu von drupal geschnappt und das passend für Clansphere umgebügelt.

Vielleicht will es ja noch irgendwer schicker machen oder benutzen

 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
1. / 2. / ... 
     /* 
    Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. 
    For licensing, see LICENSE.html or http://ckeditor.com/license 
    */ 
     
    /** 
     * @file Plugin for creating Drupal teasers(fake object).  
     */ 
    
CKEDITOR.plugins.add'cspb'
    { 
            
requires  : [ 'fakeobjects''htmldataprocessor' ], 
            
init : function( editor 
            { 
                    
// Add the style that renders our fake objects. 
                    
editor.addCss
                            
'img.cke_pagebreak, img.cke_drupal_pagebreak,img.cke_drupal_break' 
                            
'{' 
                                    
'background-image: url(' CKEDITOR.getUrlthis.path 'images/pagebreak.gif' ) + ');' 
                                    
'background-position: center center;' 
                                    
'background-repeat: repeatx;' 
                                    
'display: inline;' 
                                    
'width: 100%;' 
                                    
'height: 5px;' 
                                    
'vertical-align: middle;' 
                                    
'border: #999999 1px dotted;' 
                            
'}' ); 
     
                    
editor.ui.addButton'cspb'
                            { 
                                    
label 'CS Seitenwechsel'
                                    
command 'cspb',
                                    
icon this.path 'images/pagebreak.gif'
                            
}); 
     
     
                    function 
insertCommenteditortext 
                    { 
                            var 
ranges editor.getSelection().getRanges(), 
                                    
range ranges], 
                                    
bookmark
                            
range.splitBlock'p' ); 
                            
bookmark range.createBookmark(); 
                            var 
fakeComment CKEDITOR.dom.element.createFromHtmleditor.dataProcessor.toHtml'<!--' text '-->' ) ); 
                            
range.insertNodefakeComment ); 
                            
range.moveToElementEditStartfakeComment.getNext() ); 
                            
range.select(); 
                            return 
fakeComment
                    } 
     
                    
editor.addCommand'cspb'
                    { 
                            
exec : function( editor 
                            { 
                                    
insertCommenteditor'[pagebreak]' ); 
                            } 
                    } ); 
     
            }, 
     
            
afterInit : function( editor 
            { 
                var 
dataProcessor editor.dataProcessor
                
dataFilter dataProcessor.dataFilter
                
htmlFilter1 dataProcessor.htmlFilter
                
// Borrow the comment output filters to restore them. 
                
commentFilters htmlFilter1._.comment
                
filter commentFilters && ( commentFilters.filter || commentFilters] ); 
                
                if ( 
dataProcessor && dataFilter 
                    
// DataFilter for creating fake objects from HTML comment. 
                    
dataFilter.addRules
                            {
                                    
comment : function( namevalue 
                                    {
                                            var 
cdata value
                                            
// CData instance is received. 
                                            
if ( value.value == '[pagebreak]' || value.value == '[pagebreak]<!-- '  
                                            { 
                                                    var 
fakeElement
                                                    
// Is it actually a comment and match the desired pattern? 
                                                    
var displayName '[pagebreak]'
                                                    var 
fakeWrapper = new CKEDITOR.htmlParser.element'!--' displayName '<!-- --', {} ); 
                                                    
fakeElement editor.createFakeParserElement
                                                                    
fakeWrapper
                                                                    
'cke_pagebreak'
                                                                    
displayName
                                                                    
false ); 
                                                    
fakeElement.attributes.contenteditable "false";
                                                    
fakeElement.attributes'title' ] = displayName;
                                                    if ( 
fakeElement 
                                                    {
                                                            
delete value.name;
                                                            return 
fakeElement
                                                    } 
                                            }
                                            return 
value.value
                                    } 
                            } ); 
     
                    
// HtmlFilter rules for outputting fake comment. 
                    
function fakeCommentFilterelement 
                    { 
                            
delete element.name
                    } 
     
                    
htmlFilter1.addRules
                    { 
                            
elements 
                            { 
                                    
'pagebreak'fakeCommentFilter 
                            

                    } ); 
            } 
    } ); 
Inaktiv
Antworten: 0
Seite [1]


Sie müssen sich registrieren, um zu antworten.