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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b943e5110913001c531f5db7d229d77e32ea5f4c
4
- data.tar.gz: a2eceff57906100fde18df5daa2e4d4e84100dd1
3
+ metadata.gz: b0f12ee53bf634617b6078d2ab7a5746edfc26af
4
+ data.tar.gz: 74287cbcb52b4e34f82c8dda6290e7de0ec8c661
5
5
  SHA512:
6
- metadata.gz: 0ab284712cbccc96170b35a232529fb8f60f7237a3837822c1e69354112a2c06ced296c647e53ba0b4710e3d3b217c30101b8690ae43b6ed5417ce9cfaf66f57
7
- data.tar.gz: 5249468af79e85557d93fdf821bce440a9e75369ace10b32d4212395225540783a8ef59336e1a697dc97064a1b6a4a7dc3536efcc0f99e8a8ba7d39afae60c2c
6
+ metadata.gz: 13f00edeee34e23e6ce79e0dbf002e83e7a9b0bf8d74ffff286903ad1f7768c8c98702c9c02da5388661962aebe1f51dd423976bb25983ceedaf9ec19c46c4bd
7
+ data.tar.gz: 765a78126f55b89fe08ae294045804e1b67c40f4d2069ab258c0711a34df7f5ea6054d3f85fd3743379d57796fd4195a9df8bcb4db78526d15be2c48da8b33ba
@@ -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 != undefined)
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
- .bind("dblclick", function() {
40
- editMe(this);
41
- })
42
- .attr("title", "Double click to edit")
43
- .mouseover(function() {
44
- var htmlStr = $(this).html();
45
- if ($.trim(htmlStr) == "")
46
- $this.html("Double click to add text");
47
-
48
- $(this)
49
- .css({
50
- backgroundColor: 'AliceBlue',
51
- cursor: 'pointer'
52
- });
53
- })
54
- .mouseout(function() {
55
- if ($this.html() == "Double click to add text")
56
- $this.html("");
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 ~/ will be replaced with this
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: ~/index.html
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: ~/about.html
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='~/scripts/jquery-1.8.2.min.js'></script>
11
+ <script src='scripts/jquery-1.8.2.min.js'></script>
12
12
  <!-- Le styles -->
13
- <link href='~/<%= page.bundles["style"] %>' rel="stylesheet">
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='~/<%= page.bundles["script"] %>'></script>
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 Dir.exists? Folders[:website]
77
- throw "Website already exists!!!"
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
- if !htmlsnipet.empty?
141
- viewmodel = Hash.new
142
- viewmodel = {
143
- :name => pagename,
144
- :title => title,
145
- :url => pageurl,
146
- :data => pagedata,
147
- :rootdir => @website,
148
- :resource => resource
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
- if hasHandler
152
- ScmsUtils.log("Rendering with handler")
153
- begin
154
- viewSnippet = Handler.render(viewpath)
155
- rescue Exception=>e
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
- #todo: why not use htmlsnipet
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
- ScmsUtils.log("Empty view: #{view[1]}")
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
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.0
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-08-14 00:00:00.000000000 Z
11
+ date: 2013-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cprobert-s3sync