burp_cms 1.3.27 → 1.3.28
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: 31599760bf773b202d9e50a501ca6c538d0b9004
|
4
|
+
data.tar.gz: 8ca7fe77ffaddf14f113eb0a887140b4996a143b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 498a92d94b46a494b0f3a13fc53ea7aac510d4fccc3c9a155dd2d8d7817a9eba2493816cddf362c71d00c35e8ac5a260092c6ee557a2ab6469b1ac122c095d44
|
7
|
+
data.tar.gz: 0c4c18d1b040946cae3800e45631f0efd0cb1164fe7dbea527ef45db6cfdb5532d0bda213a3df0c9cca59a028ea187904e55d48b3810b9f24d6302aa5ce5abb6
|
@@ -8,27 +8,30 @@
|
|
8
8
|
|
9
9
|
var snippetComments = $("*:not(iframe)").contents().filter(function() {
|
10
10
|
try {
|
11
|
-
return this.nodeType
|
11
|
+
return this.nodeType === 8 && this.data.match(/snippet data-type=\"start\"/);
|
12
12
|
} catch (e) {
|
13
13
|
// Yay for not being allow to look at dom elements with external content, aka iframes
|
14
14
|
return false;
|
15
15
|
}
|
16
16
|
});
|
17
|
+
|
17
18
|
snippetComments.map(function() {
|
18
19
|
|
19
|
-
var name = this.data.match(/
|
20
|
+
var name = this.data.match(/data-name=\"(.*?)\"/)[1];
|
21
|
+
var pageId = this.data.match(/data-page-id=\"(.*?)\"/)[1];
|
20
22
|
|
21
23
|
snippets.names.push(name);
|
22
24
|
|
23
25
|
snippets.snippets[name] = {
|
26
|
+
pageId:pageId,
|
24
27
|
comment:this,
|
25
28
|
elements:function() {
|
26
29
|
|
27
30
|
var snippetElements = [];
|
28
31
|
var element = this.comment;
|
29
32
|
while(element.nextSibling) {
|
30
|
-
element = element.nextSibling
|
31
|
-
if(element.nodeType
|
33
|
+
element = element.nextSibling;
|
34
|
+
if(element.nodeType === 8 && element.data.match(/snippet data-type=\"end\"/)) {
|
32
35
|
break;
|
33
36
|
}
|
34
37
|
snippetElements.push(element);
|
@@ -250,7 +250,7 @@ $(function() {
|
|
250
250
|
|
251
251
|
$.adminDock.footer.addButton({ icon: 'save', text: 'Save', secondary: true, click:function() {
|
252
252
|
|
253
|
-
var path = window.burp_path || window.location.pathname;
|
253
|
+
var path = window.burp_path || snippets().snippets[snippetName].pageId || window.location.pathname;
|
254
254
|
if(path === "/") {
|
255
255
|
path = "/$root";
|
256
256
|
}
|
@@ -85,13 +85,20 @@ module Burp
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
@page.save
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
88
|
+
if @page.save
|
89
|
+
respond_to do |format|
|
90
|
+
format.html {
|
91
|
+
redirect_to pages_path
|
92
|
+
}
|
93
|
+
format.json { render :json => {:success => true} }
|
94
|
+
end
|
95
|
+
else
|
96
|
+
respond_to do |format|
|
97
|
+
format.html {
|
98
|
+
render :edit
|
99
|
+
}
|
100
|
+
format.json { render :json => {:success => false} }
|
101
|
+
end
|
95
102
|
end
|
96
103
|
end
|
97
104
|
end
|
data/app/lib/burp/page.rb
CHANGED
@@ -3,15 +3,16 @@ module Burp
|
|
3
3
|
|
4
4
|
class Page
|
5
5
|
|
6
|
-
attr_accessor :snippets
|
6
|
+
attr_accessor :snippets, :title, :page_id
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@snippets = options[:snippets] || {}
|
10
10
|
@title = options[:title] || ""
|
11
|
+
@page_id = options[:page_id] || ""
|
11
12
|
end
|
12
13
|
|
13
14
|
def [](location_name)
|
14
|
-
("<!-- snippet data-type=\"start\" data-name=\"#{location_name}\" -->"+(@snippets[location_name.to_sym] || "<h2>#{location_name.to_s}</h2>")+"<!-- snippet data-type=\"end\" data-name=\"#{location_name}\" -->").html_safe
|
15
|
+
("<!-- snippet data-type=\"start\" data-page-id=\"#{page_id}\" data-name=\"#{location_name}\" -->"+(@snippets[location_name.to_sym] || "<h2>#{location_name.to_s}</h2>")+"<!-- snippet data-type=\"end\" data-name=\"#{location_name}\" -->").html_safe
|
15
16
|
end
|
16
17
|
|
17
18
|
def []=(location_name,value)
|
data/lib/burp/version.rb
CHANGED
data/lib/burp_cms.rb
CHANGED
@@ -16,7 +16,7 @@ module Burp
|
|
16
16
|
def self.find_page(path)
|
17
17
|
page_model = Burp::PageModel.find(path)
|
18
18
|
if page_model
|
19
|
-
Page.new(:snippets => page_model.snippets, :title => page_model.title)
|
19
|
+
Page.new(:snippets => page_model.snippets, :title => page_model.title, :page_id => page_model.id)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
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.3.
|
4
|
+
version: 1.3.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darwin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|