scms 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/air-monkey-hook.js +24 -27
- data/assets/blank-template/_config.yml +3 -3
- data/assets/blank-template/_templates/skin.erb.html +3 -3
- data/bin/scms +3 -2
- data/lib/scms.rb +41 -39
- data/lib/scms/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: b0f12ee53bf634617b6078d2ab7a5746edfc26af
|
4
|
+
data.tar.gz: 74287cbcb52b4e34f82c8dda6290e7de0ec8c661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13f00edeee34e23e6ce79e0dbf002e83e7a9b0bf8d74ffff286903ad1f7768c8c98702c9c02da5388661962aebe1f51dd423976bb25983ceedaf9ec19c46c4bd
|
7
|
+
data.tar.gz: 765a78126f55b89fe08ae294045804e1b67c40f4d2069ab258c0711a34df7f5ea6054d3f85fd3743379d57796fd4195a9df8bcb4db78526d15be2c48da8b33ba
|
data/assets/air-monkey-hook.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/// Author Courtenay Probert
|
2
|
-
/// Version 1.1
|
2
|
+
/// Version 1.1.1
|
3
3
|
|
4
4
|
$(function() {
|
5
5
|
function editMe(cms) {
|
@@ -12,7 +12,7 @@ $(function() {
|
|
12
12
|
alert("Page missing");
|
13
13
|
|
14
14
|
try{
|
15
|
-
if(window.parentSandboxBridge
|
15
|
+
if(window.parentSandboxBridge !== undefined)
|
16
16
|
window.parentSandboxBridge.editView(view, page);
|
17
17
|
else
|
18
18
|
alert("No Parent Sandbox Bridge");
|
@@ -25,39 +25,36 @@ $(function() {
|
|
25
25
|
.attr('target','_blank')
|
26
26
|
.click(function(e){
|
27
27
|
e.preventDefault();
|
28
|
-
href = $(this).attr("href")
|
28
|
+
href = $(this).attr("href");
|
29
29
|
alert("Loading: "+ href);
|
30
30
|
window.parentSandboxBridge.openExternalURL(href);
|
31
|
-
});
|
31
|
+
});
|
32
32
|
|
33
33
|
$(".cms").each(function(i) {
|
34
34
|
var $this = $(this);
|
35
35
|
$this.addClass("cmsEdit");
|
36
36
|
var bgColor = $(this).css("background-color");
|
37
37
|
|
38
|
+
var addTextMsg = "Double click to add text";
|
38
39
|
$this
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
$this.css({
|
59
|
-
backgroundColor: bgColor
|
40
|
+
.bind("dblclick", function() {
|
41
|
+
editMe(this);
|
42
|
+
})
|
43
|
+
.attr("title", "Double click to edit")
|
44
|
+
.mouseover(function() {
|
45
|
+
if ($.trim($this.html()) === "")
|
46
|
+
$this.html(addTextMsg);
|
47
|
+
$(this).css({
|
48
|
+
backgroundColor: 'AliceBlue',
|
49
|
+
cursor: 'pointer'
|
50
|
+
});
|
51
|
+
})
|
52
|
+
.mouseout(function() {
|
53
|
+
if ($.trim($this.html()) === addTextMsg)
|
54
|
+
$this.html("");
|
55
|
+
$this.css({
|
56
|
+
backgroundColor: bgColor
|
57
|
+
});
|
60
58
|
});
|
61
|
-
|
62
|
-
});
|
59
|
+
}).attr("style", "min-height: 25px;");
|
63
60
|
});
|
@@ -1,9 +1,9 @@
|
|
1
1
|
template: _templates/skin.erb.html # The website skin (erb template)
|
2
|
-
#rooturl: http://www.mywebsite.com/ #Whats the website root when published - All references in html
|
2
|
+
#rooturl: http://www.mywebsite.com/ #Whats the website root when published - All references in html will be replaced with this
|
3
3
|
# Define your pages here
|
4
4
|
pages:
|
5
5
|
- index:
|
6
|
-
generate:
|
6
|
+
generate: index.html
|
7
7
|
navigation: Home
|
8
8
|
title: My Homepage
|
9
9
|
description: Meta description
|
@@ -12,7 +12,7 @@ pages:
|
|
12
12
|
intro: _views/home-intro.html
|
13
13
|
main: _views/home-main.html
|
14
14
|
- about:
|
15
|
-
generate:
|
15
|
+
generate: about.html
|
16
16
|
navigation: About
|
17
17
|
views:
|
18
18
|
intro: _views/about-intro.html
|
@@ -8,9 +8,9 @@
|
|
8
8
|
<meta name="keywords" content="<%= page.keywords %>">
|
9
9
|
<meta name="author" content="Courtenay Probert">
|
10
10
|
|
11
|
-
<script src='
|
11
|
+
<script src='scripts/jquery-1.8.2.min.js'></script>
|
12
12
|
<!-- Le styles -->
|
13
|
-
<link href='
|
13
|
+
<link href='<%= page.bundles["style"] %>' rel="stylesheet">
|
14
14
|
<style type="text/css">
|
15
15
|
body {
|
16
16
|
padding-top: 60px;
|
@@ -99,7 +99,7 @@
|
|
99
99
|
<!-- Le javascript
|
100
100
|
================================================== -->
|
101
101
|
<!-- Placed at the end of the document so the pages load faster -->
|
102
|
-
<script src='
|
102
|
+
<script src='<%= page.bundles["script"] %>'></script>
|
103
103
|
<%= page.monkeyhook %>
|
104
104
|
</body>
|
105
105
|
</html>
|
data/bin/scms
CHANGED
@@ -73,8 +73,9 @@ Folders = {
|
|
73
73
|
}
|
74
74
|
|
75
75
|
if options[:action] == "create"
|
76
|
-
if
|
77
|
-
|
76
|
+
if File.exists?(File.join(Folders[:website], "_config.yml"))
|
77
|
+
#if Dir.exists? Folders[:website]
|
78
|
+
"Website already exists!!!"
|
78
79
|
else
|
79
80
|
puts "Making website: #{Folders[:website]}"
|
80
81
|
FileUtils.mkdir_p Folders[:website]
|
data/lib/scms.rb
CHANGED
@@ -64,6 +64,7 @@ module Scms
|
|
64
64
|
pagedata.each do |pageoptions|
|
65
65
|
pagename = pageoptions[0]
|
66
66
|
pageconfig = pageoptions[1]
|
67
|
+
pageurl = "about:blank"
|
67
68
|
pageurl = pageconfig["generate"]
|
68
69
|
pageurl = pageconfig["url"] unless pageconfig["url"] == nil
|
69
70
|
navtext = pageconfig["navigation"]
|
@@ -137,52 +138,53 @@ module Scms
|
|
137
138
|
ScmsUtils.errLog(e.message)
|
138
139
|
ScmsUtils.log(e.backtrace.inspect)
|
139
140
|
end
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
141
|
+
|
142
|
+
if htmlsnipet.empty?
|
143
|
+
ScmsUtils.log("Empty view: #{view[1]}")
|
144
|
+
end
|
145
|
+
|
146
|
+
viewmodel = Hash.new
|
147
|
+
viewmodel = {
|
148
|
+
:name => pagename,
|
149
|
+
:title => title,
|
150
|
+
:url => pageurl,
|
151
|
+
:data => pagedata,
|
152
|
+
:rootdir => @website,
|
153
|
+
:resource => resource
|
154
|
+
}
|
150
155
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
+
if hasHandler
|
157
|
+
ScmsUtils.log("Rendering with handler")
|
158
|
+
begin
|
159
|
+
viewSnippet = Handler.render(viewpath)
|
160
|
+
rescue Exception=>e
|
161
|
+
ScmsUtils.errLog(e.message)
|
162
|
+
ScmsUtils.log(e.backtrace.inspect)
|
163
|
+
end
|
164
|
+
|
165
|
+
else
|
166
|
+
#todo: why not use htmlsnipet
|
167
|
+
snnipetCode = File.read(viewpath)
|
168
|
+
case File.extname(view[1])
|
169
|
+
when ".md"
|
170
|
+
begin
|
171
|
+
doc = Maruku.new(snnipetCode)
|
172
|
+
viewSnippet = doc.to_html
|
173
|
+
rescue Exception => e
|
174
|
+
viewSnippet = snnipetCode
|
156
175
|
ScmsUtils.errLog(e.message)
|
157
176
|
ScmsUtils.log(e.backtrace.inspect)
|
177
|
+
#todo: use scmslog
|
158
178
|
end
|
159
|
-
|
160
179
|
else
|
161
|
-
|
162
|
-
snnipetCode = File.read(viewpath)
|
163
|
-
case File.extname(view[1])
|
164
|
-
when ".md"
|
165
|
-
begin
|
166
|
-
doc = Maruku.new(snnipetCode)
|
167
|
-
viewSnippet = doc.to_html
|
168
|
-
rescue Exception => e
|
169
|
-
viewSnippet = snnipetCode
|
170
|
-
ScmsUtils.errLog(e.message)
|
171
|
-
ScmsUtils.log(e.backtrace.inspect)
|
172
|
-
#todo: use scmslog
|
173
|
-
end
|
174
|
-
else
|
175
|
-
viewSnippet = snnipetCode
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
if @mode == "cms"
|
180
|
-
views[view[0]] = "<div class='cms' data-view='#{view[1]}' data-page='#{pageurl}'>#{Scms.parsetemplate(viewSnippet, viewmodel)}</div>"
|
181
|
-
else
|
182
|
-
views[view[0]] = Scms.parsetemplate(viewSnippet, viewmodel)
|
180
|
+
viewSnippet = snnipetCode
|
183
181
|
end
|
182
|
+
end
|
183
|
+
|
184
|
+
if @mode == "cms"
|
185
|
+
views[view[0]] = "<div class='cms' data-view='#{view[1]}' data-page='#{pageurl}'>#{Scms.parsetemplate(viewSnippet, viewmodel)}</div>"
|
184
186
|
else
|
185
|
-
|
187
|
+
views[view[0]] = Scms.parsetemplate(viewSnippet, viewmodel)
|
186
188
|
end
|
187
189
|
else
|
188
190
|
ScmsUtils.errLog("View not found: #{view[0]} - #{view[1]} [#{viewpath}]")
|
data/lib/scms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courtenay Probert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cprobert-s3sync
|