burp_cms 1.5.4 → 1.5.5
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 +4 -4
 - data/app/assets/packages/burp/editing/js/main.js +30 -22
 - data/app/assets/packages/burp/editing/js/snippets.js +17 -6
 - data/lib/burp/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 1c13ef9c316a9bca2ecfc2a1fbfa50708ecb86a0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: cc7daabdc05dbd01a448bccbae0dd740732a01f6
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6c9fb18edc49829ca6289270e20ac120dc264fa9936d573be52915722d931857ff621a56e44e260f55678371de6d8a845fced3fb27f89509706bf9612c597fd6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 52d1196315a1215cafc2cf7226d25dc1eae48d029ca69c296901ae61e3572df260a40e7b7a379f904273a02b47ae602b4e76ccb7a3f6d827ab9e81a7f2cc76c2
         
     | 
| 
         @@ -13,7 +13,7 @@ $(function() { 
     | 
|
| 
       13 
13 
     | 
    
         
             
              var editor;
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
              function getPathFor(snippetName) {
         
     | 
| 
       16 
     | 
    
         
            -
                var path =  
     | 
| 
      
 16 
     | 
    
         
            +
                var path = snippets().snippets[snippetName].pageId || window.burp_path || window.location.pathname;
         
     | 
| 
       17 
17 
     | 
    
         
             
                if(path === "/") {
         
     | 
| 
       18 
18 
     | 
    
         
             
                  path = "/$root";
         
     | 
| 
       19 
19 
     | 
    
         
             
                }
         
     | 
| 
         @@ -292,31 +292,39 @@ $(function() { 
     | 
|
| 
       292 
292 
     | 
    
         | 
| 
       293 
293 
     | 
    
         
             
                $.adminDock.footer.addButton({ icon: 'save', text: 'Save', secondary: true, click:function() {
         
     | 
| 
       294 
294 
     | 
    
         | 
| 
       295 
     | 
    
         
            -
                  var path = getPathFor(snippetName);
         
     | 
| 
       296 
295 
     | 
    
         
             
                  snippetCache = {};
         
     | 
| 
       297 
296 
     | 
    
         | 
| 
       298 
     | 
    
         
            -
                   
     | 
| 
       299 
     | 
    
         
            -
             
     | 
| 
       300 
     | 
    
         
            -
             
     | 
| 
       301 
     | 
    
         
            -
                     
     | 
| 
       302 
     | 
    
         
            -
             
     | 
| 
       303 
     | 
    
         
            -
             
     | 
| 
       304 
     | 
    
         
            -
             
     | 
| 
       305 
     | 
    
         
            -
             
     | 
| 
       306 
     | 
    
         
            -
             
     | 
| 
       307 
     | 
    
         
            -
             
     | 
| 
       308 
     | 
    
         
            -
             
     | 
| 
       309 
     | 
    
         
            -
             
     | 
| 
       310 
     | 
    
         
            -
             
     | 
| 
       311 
     | 
    
         
            -
             
     | 
| 
       312 
     | 
    
         
            -
             
     | 
| 
       313 
     | 
    
         
            -
             
     | 
| 
       314 
     | 
    
         
            -
             
     | 
| 
       315 
     | 
    
         
            -
             
     | 
| 
       316 
     | 
    
         
            -
             
     | 
| 
       317 
     | 
    
         
            -
                     
     | 
| 
      
 297 
     | 
    
         
            +
                  var paths = {};
         
     | 
| 
      
 298 
     | 
    
         
            +
                  
         
     | 
| 
      
 299 
     | 
    
         
            +
                  $.each(snippetEditorState, function(snippetName, data) {
         
     | 
| 
      
 300 
     | 
    
         
            +
                    var path = getPathFor(snippetName);
         
     | 
| 
      
 301 
     | 
    
         
            +
                    paths[path] = paths[path] || [];
         
     | 
| 
      
 302 
     | 
    
         
            +
                    paths[path].push(snippetName);
         
     | 
| 
      
 303 
     | 
    
         
            +
                  });
         
     | 
| 
      
 304 
     | 
    
         
            +
                  
         
     | 
| 
      
 305 
     | 
    
         
            +
                  
         
     | 
| 
      
 306 
     | 
    
         
            +
                  var ajaxRequests = [];
         
     | 
| 
      
 307 
     | 
    
         
            +
                  
         
     | 
| 
      
 308 
     | 
    
         
            +
                  $.each(paths, function(path, snippetNames) {
         
     | 
| 
      
 309 
     | 
    
         
            +
                    
         
     | 
| 
      
 310 
     | 
    
         
            +
                    var  data = {snippets:{}};
         
     | 
| 
      
 311 
     | 
    
         
            +
             
     | 
| 
      
 312 
     | 
    
         
            +
                    $.each(snippetNames, function(index, snippetName) {
         
     | 
| 
      
 313 
     | 
    
         
            +
                      data.snippets[snippetName] = markdown2Html(snippetEditorState[snippetName]);
         
     | 
| 
      
 314 
     | 
    
         
            +
                    });
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
      
 316 
     | 
    
         
            +
                    ajaxRequests.push($.ajax("/burp/pages/"+path,{
         
     | 
| 
      
 317 
     | 
    
         
            +
                      type:"post",
         
     | 
| 
      
 318 
     | 
    
         
            +
                      data:{page:data, '_method':"put"},
         
     | 
| 
      
 319 
     | 
    
         
            +
                      dataType:'json',
         
     | 
| 
      
 320 
     | 
    
         
            +
                      success:function() {}
         
     | 
| 
      
 321 
     | 
    
         
            +
                    }));
         
     | 
| 
      
 322 
     | 
    
         
            +
                    
         
     | 
| 
       318 
323 
     | 
    
         
             
                  });
         
     | 
| 
       319 
324 
     | 
    
         | 
| 
      
 325 
     | 
    
         
            +
                  $.when(ajaxRequests).done(function() {
         
     | 
| 
      
 326 
     | 
    
         
            +
                    alert("The page has been saved!");
         
     | 
| 
      
 327 
     | 
    
         
            +
                  });
         
     | 
| 
       320 
328 
     | 
    
         | 
| 
       321 
329 
     | 
    
         
             
                }});
         
     | 
| 
       322 
330 
     | 
    
         | 
| 
         @@ -2,6 +2,17 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
              var $ = jQuery;
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
              function getData(string) {
         
     | 
| 
      
 6 
     | 
    
         
            +
                var data = {};
         
     | 
| 
      
 7 
     | 
    
         
            +
                
         
     | 
| 
      
 8 
     | 
    
         
            +
                $.each(string.match(/data-(.*?)="(.*?)"/g) || [], function(index, value) {
         
     | 
| 
      
 9 
     | 
    
         
            +
                  var match = value.match(/data-(.*?)="(.*?)"/);
         
     | 
| 
      
 10 
     | 
    
         
            +
                  data[match[1]] = match[2];
         
     | 
| 
      
 11 
     | 
    
         
            +
                });
         
     | 
| 
      
 12 
     | 
    
         
            +
                
         
     | 
| 
      
 13 
     | 
    
         
            +
                return data;
         
     | 
| 
      
 14 
     | 
    
         
            +
              }
         
     | 
| 
      
 15 
     | 
    
         
            +
              
         
     | 
| 
       5 
16 
     | 
    
         
             
              window.snippets = function() {
         
     | 
| 
       6 
17 
     | 
    
         | 
| 
       7 
18 
     | 
    
         
             
                var snippets = {names:[],snippets:{}};
         
     | 
| 
         @@ -15,15 +26,15 @@ 
     | 
|
| 
       15 
26 
     | 
    
         
             
                  }
         
     | 
| 
       16 
27 
     | 
    
         
             
                });
         
     | 
| 
       17 
28 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                snippetComments. 
     | 
| 
      
 29 
     | 
    
         
            +
                snippetComments.each(function() {
         
     | 
| 
       19 
30 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                  var  
     | 
| 
       21 
     | 
    
         
            -
                  var pageId = this.data.match(/data-page-id=\"(.*?)\"/)[1];
         
     | 
| 
      
 31 
     | 
    
         
            +
                  var data = getData(this.data);
         
     | 
| 
       22 
32 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                  snippets.names.push(name);
         
     | 
| 
      
 33 
     | 
    
         
            +
                  snippets.names.push(data['name']);
         
     | 
| 
       24 
34 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
                  snippets.snippets[name] = {
         
     | 
| 
       26 
     | 
    
         
            -
                    pageId: 
     | 
| 
      
 35 
     | 
    
         
            +
                  snippets.snippets[data['name']] = {
         
     | 
| 
      
 36 
     | 
    
         
            +
                    pageId:data['page-id'],
         
     | 
| 
      
 37 
     | 
    
         
            +
                    data:data,
         
     | 
| 
       27 
38 
     | 
    
         
             
                    comment:this,
         
     | 
| 
       28 
39 
     | 
    
         
             
                    elements:function() {
         
     | 
| 
       29 
40 
     | 
    
         | 
    
        data/lib/burp/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: burp_cms
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.5.5
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Darwin
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-05-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: jquery-rails
         
     |