burp_cms 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b66d58dd292c111e95c3a40956ede7dec5d8b647
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: dc9b9619b4fa6c18e3e4d907adc9e301674ec7df
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 94489889d76ae8f8ff66d95d4e4b03d24f092cdc873730bd14402e93e96261fb6f2093cddcdd72552a1d1cfc30845dc115d23ad77354cc11d793ea49116d584d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9738290fae41c0562b77a05dc90c1947bcd856b96d42d585a8edfa443fc65139704307a458d81ade8a1d65a44742c974e79d33f8d1af1269d1651430225bf6e5
         
     | 
| 
         @@ -16,14 +16,15 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  },
         
     | 
| 
       17 
17 
     | 
    
         
             
                  append: function(snippetName, element) {
         
     | 
| 
       18 
18 
     | 
    
         
             
                    console.debug('append', snippetName, element);
         
     | 
| 
      
 19 
     | 
    
         
            +
                  },
         
     | 
| 
      
 20 
     | 
    
         
            +
                  setPositionClass: function(className, element) {
         
     | 
| 
      
 21 
     | 
    
         
            +
                    console.debug('setPositionClass', className, element);
         
     | 
| 
       19 
22 
     | 
    
         
             
                  }
         
     | 
| 
       20 
23 
     | 
    
         
             
                };
         
     | 
| 
       21 
24 
     | 
    
         | 
| 
       22 
25 
     | 
    
         
             
                if (typeof(options) === 'object') {
         
     | 
| 
       23 
26 
     | 
    
         
             
                  this.onUpdate = options['update'];
         
     | 
| 
       24 
27 
     | 
    
         
             
                }
         
     | 
| 
       25 
     | 
    
         
            -
                
         
     | 
| 
       26 
     | 
    
         
            -
                this.init();
         
     | 
| 
       27 
28 
     | 
    
         
             
              }
         
     | 
| 
       28 
29 
     | 
    
         | 
| 
       29 
30 
     | 
    
         
             
              window.ContentDecorator = ContentDecorator;
         
     | 
| 
         @@ -32,10 +33,13 @@ 
     | 
|
| 
       32 
33 
     | 
    
         
             
                $('body > .dropbox').remove();
         
     | 
| 
       33 
34 
     | 
    
         
             
              }
         
     | 
| 
       34 
35 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
              function initializeMovable(contentEditor, elements,  
     | 
| 
      
 36 
     | 
    
         
            +
              function initializeMovable(contentEditor, elements, cloneImage) {
         
     | 
| 
       36 
37 
     | 
    
         
             
                if (!$(elements).hasClass('movable')) {
         
     | 
| 
       37 
38 
     | 
    
         | 
| 
       38 
39 
     | 
    
         
             
                  $(elements).addClass('movable');
         
     | 
| 
      
 40 
     | 
    
         
            +
                  if(typeof(cloneImage) === "undefined") {
         
     | 
| 
      
 41 
     | 
    
         
            +
                    cloneImage = false;
         
     | 
| 
      
 42 
     | 
    
         
            +
                  }
         
     | 
| 
       39 
43 
     | 
    
         | 
| 
       40 
44 
     | 
    
         
             
                  $(elements).draggable({
         
     | 
| 
       41 
45 
     | 
    
         
             
                    cursor: 'move',
         
     | 
| 
         @@ -142,28 +146,34 @@ 
     | 
|
| 
       142 
146 
     | 
    
         
             
                        drop: function(event, ui) {              
         
     | 
| 
       143 
147 
     | 
    
         | 
| 
       144 
148 
     | 
    
         
             
                          if(!ui.draggable.data("removed")) {
         
     | 
| 
       145 
     | 
    
         
            -
                             
     | 
| 
       146 
     | 
    
         
            -
                            var  
     | 
| 
       147 
     | 
    
         
            -
             
     | 
| 
       148 
     | 
    
         
            -
                            initializeMovable(contentEditor, img, function(element, positionClass) { 
         
     | 
| 
       149 
     | 
    
         
            -
                              $(element).removeClass('left center right ui-droppable movable ui-draggable');
         
     | 
| 
       150 
     | 
    
         
            -
                              $(element).addClass(positionClass);
         
     | 
| 
       151 
     | 
    
         
            -
                              return element;
         
     | 
| 
       152 
     | 
    
         
            -
                            });
         
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
      
 149 
     | 
    
         
            +
                            
         
     | 
| 
      
 150 
     | 
    
         
            +
                            var className = $(this).removeClass('dropzone ui-droppable')[0].className;
         
     | 
| 
      
 151 
     | 
    
         
            +
                            var imageElement = ui.draggable[0];
         
     | 
| 
       154 
152 
     | 
    
         
             
                            var markdown = $(this).parent().data("target-element");
         
     | 
| 
       155 
153 
     | 
    
         | 
| 
       156 
     | 
    
         
            -
                             
     | 
| 
       157 
     | 
    
         
            -
                             
     | 
| 
       158 
     | 
    
         
            -
                              $(img).attr('src',src.replace(/\/files\/small\//,'/files/large/'));
         
     | 
| 
       159 
     | 
    
         
            -
                            }
         
     | 
| 
      
 154 
     | 
    
         
            +
                            $(imageElement).removeClass('left center right');
         
     | 
| 
      
 155 
     | 
    
         
            +
                            $(imageElement).addClass(className);
         
     | 
| 
       160 
156 
     | 
    
         | 
| 
       161 
     | 
    
         
            -
                            if( 
     | 
| 
       162 
     | 
    
         
            -
                               
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
       165 
     | 
    
         
            -
                              $(img). 
     | 
| 
       166 
     | 
    
         
            -
                               
     | 
| 
      
 157 
     | 
    
         
            +
                            if(markdown === imageElement) {
         
     | 
| 
      
 158 
     | 
    
         
            +
                              contentEditor.callbacks.setPositionClass(className, $(imageElement));
         
     | 
| 
      
 159 
     | 
    
         
            +
                            } else {
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
                              // var src = $(img).attr('src');
         
     | 
| 
      
 162 
     | 
    
         
            +
                              // if(src.match(/\/files\/small\//)) {
         
     | 
| 
      
 163 
     | 
    
         
            +
                              //   $(img).attr('src', src.replace(/\/files\/small\//,'/files/large/'));
         
     | 
| 
      
 164 
     | 
    
         
            +
                              // }
         
     | 
| 
      
 165 
     | 
    
         
            +
                              
         
     | 
| 
      
 166 
     | 
    
         
            +
                              if(cloneImage) {
         
     | 
| 
      
 167 
     | 
    
         
            +
                                imageElement = $(imageElement).clone();
         
     | 
| 
      
 168 
     | 
    
         
            +
                              }
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
                              if($(this).parent().is(".bottom-dropbox")) {
         
     | 
| 
      
 171 
     | 
    
         
            +
                                snippets().snippets[contentEditor.snippetName].append($(imageElement));
         
     | 
| 
      
 172 
     | 
    
         
            +
                                contentEditor.callbacks.append(contentEditor.snippetName, $(imageElement));
         
     | 
| 
      
 173 
     | 
    
         
            +
                              } else {
         
     | 
| 
      
 174 
     | 
    
         
            +
                                $(imageElement).insertBefore(markdown);
         
     | 
| 
      
 175 
     | 
    
         
            +
                                contentEditor.callbacks.insertBefore($(markdown), $(imageElement));
         
     | 
| 
      
 176 
     | 
    
         
            +
                              }
         
     | 
| 
       167 
177 
     | 
    
         
             
                            }
         
     | 
| 
       168 
178 
     | 
    
         | 
| 
       169 
179 
     | 
    
         
             
                            clearDropBoxes();
         
     | 
| 
         @@ -191,18 +201,6 @@ 
     | 
|
| 
       191 
201 
     | 
    
         | 
| 
       192 
202 
     | 
    
         
             
              $.extend(ContentDecorator.prototype, {
         
     | 
| 
       193 
203 
     | 
    
         | 
| 
       194 
     | 
    
         
            -
                init: function() {
         
     | 
| 
       195 
     | 
    
         
            -
                  var contentEditor = this;
         
     | 
| 
       196 
     | 
    
         
            -
                  $(this.element).find("> .movable").each(function() {
         
     | 
| 
       197 
     | 
    
         
            -
                    $(this).removeClass('movable');
         
     | 
| 
       198 
     | 
    
         
            -
                    initializeMovable(contentEditor, this, function(element, positionClass) { 
         
     | 
| 
       199 
     | 
    
         
            -
                      $(element).removeClass('left center right ui-droppable movable ui-draggable');
         
     | 
| 
       200 
     | 
    
         
            -
                      $(element).addClass(positionClass);
         
     | 
| 
       201 
     | 
    
         
            -
                      return element;
         
     | 
| 
       202 
     | 
    
         
            -
                    });
         
     | 
| 
       203 
     | 
    
         
            -
                  });
         
     | 
| 
       204 
     | 
    
         
            -
                },
         
     | 
| 
       205 
     | 
    
         
            -
                
         
     | 
| 
       206 
204 
     | 
    
         
             
                setSnippetName: function(snippetName) {
         
     | 
| 
       207 
205 
     | 
    
         
             
                  this.snippetName = snippetName;
         
     | 
| 
       208 
206 
     | 
    
         
             
                },
         
     | 
| 
         @@ -270,8 +268,8 @@ 
     | 
|
| 
       270 
268 
     | 
    
         
             
                //       },10);
         
     | 
| 
       271 
269 
     | 
    
         
             
                //     },
         
     | 
| 
       272 
270 
     | 
    
         | 
| 
       273 
     | 
    
         
            -
                makeDroppable: function(elements,  
     | 
| 
       274 
     | 
    
         
            -
                  initializeMovable(this, elements,  
     | 
| 
      
 271 
     | 
    
         
            +
                makeDroppable: function(elements, cloneImage) {
         
     | 
| 
      
 272 
     | 
    
         
            +
                  initializeMovable(this, elements, cloneImage);
         
     | 
| 
       275 
273 
     | 
    
         
             
                },
         
     | 
| 
       276 
274 
     | 
    
         | 
| 
       277 
275 
     | 
    
         
             
                addRemoveZone: function(element) {
         
     | 
| 
         @@ -90,9 +90,7 @@ $(function() { 
     | 
|
| 
       90 
90 
     | 
    
         
             
                    }
         
     | 
| 
       91 
91 
     | 
    
         
             
                  });
         
     | 
| 
       92 
92 
     | 
    
         | 
| 
       93 
     | 
    
         
            -
                  contentDecorator.makeDroppable('#gallery img',  
     | 
| 
       94 
     | 
    
         
            -
                    return $("<img src='" + $(element).attr('src') + "' class='" + positionClass + "' />");
         
     | 
| 
       95 
     | 
    
         
            -
                  });
         
     | 
| 
      
 93 
     | 
    
         
            +
                  contentDecorator.makeDroppable('#gallery img', true);
         
     | 
| 
       96 
94 
     | 
    
         | 
| 
       97 
95 
     | 
    
         
             
                  $('#gallery').trigger('reset');
         
     | 
| 
       98 
96 
     | 
    
         
             
                });
         
     | 
| 
         @@ -156,9 +154,7 @@ $(function() { 
     | 
|
| 
       156 
154 
     | 
    
         
             
                domSnippetState[snippetName] = elements.clone();
         
     | 
| 
       157 
155 
     | 
    
         
             
                snippets().snippets[snippetName].update(elements);
         
     | 
| 
       158 
156 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
                contentDecorator.makeDroppable(elements,  
     | 
| 
       160 
     | 
    
         
            -
                  return $("<img src='" + $(element).attr('src') + "' class='" + positionClass + "' />");
         
     | 
| 
       161 
     | 
    
         
            -
                });
         
     | 
| 
      
 157 
     | 
    
         
            +
                contentDecorator.makeDroppable(elements, false);
         
     | 
| 
       162 
158 
     | 
    
         
             
              }
         
     | 
| 
       163 
159 
     | 
    
         | 
| 
       164 
160 
     | 
    
         
             
              function addEditor() {
         
     | 
| 
         @@ -348,13 +344,16 @@ $(function() { 
     | 
|
| 
       348 
344 
     | 
    
         
             
                      insertBefore: function(beforeElement, element) {
         
     | 
| 
       349 
345 
     | 
    
         
             
                        $(element).removeClass('ui-droppable movable ui-draggable');
         
     | 
| 
       350 
346 
     | 
    
         | 
| 
      
 347 
     | 
    
         
            +
                        var remove_eid = element.attr('eid');
         
     | 
| 
      
 348 
     | 
    
         
            +
                        var remove_cssSelector = '[eid="'+ remove_eid +'"]';
         
     | 
| 
      
 349 
     | 
    
         
            +
                        
         
     | 
| 
       351 
350 
     | 
    
         
             
                        var eid = beforeElement.attr('eid');
         
     | 
| 
       352 
351 
     | 
    
         
             
                        var snippetName = eid.split(/-/)[0];
         
     | 
| 
       353 
     | 
    
         
            -
                        
         
     | 
| 
       354 
352 
     | 
    
         
             
                        var cssSelector = '[eid="'+ eid +'"]';
         
     | 
| 
       355 
353 
     | 
    
         | 
| 
       356 
354 
     | 
    
         
             
                        var root = $('<div></div>');
         
     | 
| 
       357 
355 
     | 
    
         
             
                        root.append(domSnippetState[snippetName]);
         
     | 
| 
      
 356 
     | 
    
         
            +
                        root.find(remove_cssSelector).remove();
         
     | 
| 
       358 
357 
     | 
    
         
             
                        element.insertBefore(root.find(cssSelector));
         
     | 
| 
       359 
358 
     | 
    
         
             
                        domSnippetState[snippetName] = root.children();
         
     | 
| 
       360 
359 
     | 
    
         | 
| 
         @@ -369,6 +368,25 @@ $(function() { 
     | 
|
| 
       369 
368 
     | 
    
         | 
| 
       370 
369 
     | 
    
         
             
                        domSnippetState[snippetName] = $('<div></div>').append(domSnippetState[snippetName]).append(element).children();
         
     | 
| 
       371 
370 
     | 
    
         | 
| 
      
 371 
     | 
    
         
            +
                        snippetEditorState[snippetName] = Html2Markdown(removeIDs(domSnippetState[snippetName]));
         
     | 
| 
      
 372 
     | 
    
         
            +
                        loadSnippet(snippetName, function(snippet) {
         
     | 
| 
      
 373 
     | 
    
         
            +
                          editor.setValue(snippet);
         
     | 
| 
      
 374 
     | 
    
         
            +
                          editor.refresh();
         
     | 
| 
      
 375 
     | 
    
         
            +
                        });
         
     | 
| 
      
 376 
     | 
    
         
            +
                      },
         
     | 
| 
      
 377 
     | 
    
         
            +
                      setPositionClass: function(positionClassName, imageElement) {
         
     | 
| 
      
 378 
     | 
    
         
            +
                        
         
     | 
| 
      
 379 
     | 
    
         
            +
                        var eid = $(imageElement).attr('eid');
         
     | 
| 
      
 380 
     | 
    
         
            +
                        var snippetName = eid.split(/-/)[0];
         
     | 
| 
      
 381 
     | 
    
         
            +
                        
         
     | 
| 
      
 382 
     | 
    
         
            +
                        var cssSelector = '[eid="'+ eid +'"]';
         
     | 
| 
      
 383 
     | 
    
         
            +
                        
         
     | 
| 
      
 384 
     | 
    
         
            +
                        var root = $('<div></div>');
         
     | 
| 
      
 385 
     | 
    
         
            +
                        root.append(domSnippetState[snippetName]);
         
     | 
| 
      
 386 
     | 
    
         
            +
                        root.find(cssSelector).removeClass("left right center");
         
     | 
| 
      
 387 
     | 
    
         
            +
                        root.find(cssSelector).addClass(positionClassName);
         
     | 
| 
      
 388 
     | 
    
         
            +
                        domSnippetState[snippetName] = root.children();
         
     | 
| 
      
 389 
     | 
    
         
            +
                        
         
     | 
| 
       372 
390 
     | 
    
         
             
                        snippetEditorState[snippetName] = Html2Markdown(removeIDs(domSnippetState[snippetName]));
         
     | 
| 
       373 
391 
     | 
    
         
             
                        loadSnippet(snippetName, function(snippet) {
         
     | 
| 
       374 
392 
     | 
    
         
             
                          editor.setValue(snippet);
         
     | 
    
        data/lib/burp/version.rb
    CHANGED