copy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Copy is a sinatra-based content management system.
2
2
 
3
- Copy is similar to [Brochure](https://github.com/sstephenson/brochure) in spirit, but with the edition of editable text blocks.
3
+ Copy is similar to [Brochure](https://github.com/sstephenson/brochure) in spirit, but with the addition of editable text blocks.
4
4
 
5
5
  More soon.
6
6
 
data/bin/copy CHANGED
@@ -1,9 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rubygems'
4
- require 'optparse'
5
- require 'copy'
3
+ begin
4
+ require 'copy'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'copy'
8
+ end
9
+
6
10
  require 'copy/version'
11
+ require 'optparse'
7
12
 
8
13
  OptionParser.new do |opts|
9
14
  opts.banner = "Usage: copy [options]"
@@ -16,7 +16,6 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency "sinatra", "~> 1.2.6"
18
18
  s.add_dependency "redcarpet"
19
- s.add_dependency "choice"
20
19
 
21
20
  s.add_development_dependency "mocha"
22
21
 
@@ -51,6 +51,6 @@
51
51
  #_copy textarea {
52
52
  font-size: 13px;
53
53
  height: 300px;
54
- width: 500px;
54
+ width: 490px;
55
55
  padding: 5px;
56
56
  }
@@ -4,6 +4,15 @@ jQuery.noConflict();
4
4
 
5
5
  (function($) {
6
6
  $(function() {
7
+ // Short-circuit if this has run already (bookmarklet clicked twice).
8
+ if (window._copy_initialized) {
9
+ // Make the blocks clickable unless the Copy dialog is present.
10
+ if ($('#_copy').length == 0) {
11
+ clickable();
12
+ }
13
+ return true;
14
+ }
15
+
7
16
  function clickable() {
8
17
  $('._copy_editable').addClass('_copy_clickable');
9
18
  }
@@ -12,7 +21,7 @@ jQuery.noConflict();
12
21
  $('._copy_editable').removeClass('_copy_clickable');
13
22
  }
14
23
 
15
- $('head').append('<style style="text/css"><%= File.read(settings.root + '/admin/copy.css').gsub(/\n/, " \\\n") %></style>');
24
+ $('head').append('<style><%= File.read(settings.root + '/admin/copy.css').gsub(/\n/, " \\\n") %></style>');
16
25
 
17
26
  $('._copy_clickable').live('click', function() {
18
27
  var copy = $(this);
@@ -49,5 +58,6 @@ jQuery.noConflict();
49
58
  })
50
59
 
51
60
  clickable();
61
+ window._copy_initialized = true;
52
62
  });
53
63
  })(jQuery);
@@ -1,4 +1,9 @@
1
- require 'copy'
1
+ begin
2
+ require 'copy'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require 'copy'
6
+ end
2
7
 
3
8
  Copy::Server.config do
4
9
  # Sets a Cache-Control header for the duration specified.
@@ -1,3 +1,3 @@
1
1
  module Copy
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javan Makhmali
@@ -48,24 +48,10 @@ dependencies:
48
48
  version: "0"
49
49
  type: :runtime
50
50
  version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: choice
53
- prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- type: :runtime
64
- version_requirements: *id003
65
51
  - !ruby/object:Gem::Dependency
66
52
  name: mocha
67
53
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
69
55
  none: false
70
56
  requirements:
71
57
  - - ">="
@@ -75,7 +61,7 @@ dependencies:
75
61
  - 0
76
62
  version: "0"
77
63
  type: :development
78
- version_requirements: *id004
64
+ version_requirements: *id003
79
65
  description: Serve mostly static pages with blocks of client-editable text.
80
66
  email:
81
67
  - javan@javan.us