Giter VIP home page Giter VIP logo

clipboard_image_paste's People

Contributors

athomsen avatar battlej avatar ezequielgonzalez avatar ilya-tsykunov avatar iquiw avatar jwalkerbg avatar khoffrath avatar kirillsmirnov avatar ks780 avatar mapb1990 avatar mouson avatar octane100 avatar papisz avatar peclik avatar rangler2 avatar tamtamchik avatar tkusukawa avatar ucho avatar utopism avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clipboard_image_paste's Issues

No compatibility with Rails >5.0

"ActionDispatch::Callbacks.to_prepare do" in init.rb is depreciated, I believe it can just be replaced with:

"ActiveSupport::Reloader.to_prepare do"

"alias_method_chain :save_attachments, :pasted_images" in attachment_patch.rb is depreciated (alias_method_chain), it needs to be replaced with Module#prepend but I don't know ruby so I don't really know how to do this.

ActionView::Template::Error

After installing on redmine 2.5.2, I get the following error:

Started GET "/login?back_url=https%3A%2F%2Fredmine-test.eutecus.com%2F" for 80.98.254.83 at 2015-10-11 11:44:04 -0700
Processing by AccountController#login as HTML
  Parameters: {"back_url"=>"https://redmine-test.eutecus.com/"}
  Current user: anonymous
  Rendered account/login.html.erb within layouts/base (1.5ms)
Missing template, responding with 404
  Rendered common/error.html.erb within layouts/base (0.0ms)
Completed 500 Internal Server Error in 10.5ms

ActionView::Template::Error (Missing partial clipboard_image_paste/headers with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :rsb]}. Searched in:
  * "/usr/share/redmine/app/views"
):
    11: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
    12: <%= javascript_heads %>
    13: <%= heads_for_theme %>
    14: <%= call_hook :view_layouts_base_html_head %>
    15: <!-- page specific tags -->
    16: <%= yield :header_tags -%>
    17: </head>
  lib/redmine/hook.rb:111:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/views/layouts/base.html.erb:14:in `_app_views_layouts_base_html_erb___3984061904807760966_44002140'
  app/controllers/application_controller.rb:452:in `block (2 levels) in render_error'
  app/controllers/application_controller.rb:450:in `render_error'
  app/controllers/application_controller.rb:438:in `render_404'
  app/controllers/application_controller.rb:462:in `missing_template'

Import image vom "greenshot"

Hi there,

its a llitle bit strange, but I can´t paste images from greenshot (getgreenshot.org) directly into this plugin. Everytime the message "Die Zwischenablage enthält kein Bild. Drücken Sie die Druck-Taste erneut" (means: there is not image; please press the print-key) pops up.
when I paste an image from greenshot to word -> copy the image in word an paste it into plugin: It works.

Has anyone an idea, what is going wrong between greenshot and this plugin?

edit:
additional to the problem with images from greenshot: the same failure comes by copy´n´paste images from mail (MS Outlook) :-/

Regard
Christian Buczek

found error in log file,does it serious?

the log part

Processing by IssuesController#new as HTML
  Parameters: {"project_id"=>"trip_operation", "copy_from"=>"35745"}
  Current user: 88752 (id=239)
  Rendered common/error.html.erb within layouts/base (0.3ms)
  Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_headers.html.erb (0.5ms)
  Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_add_form.html.erb (3.2ms)
Completed 403 Forbidden in 67ms (Views: 13.0ms | ActiveRecord: 8.5ms)
Started GET "/projects/trip_operation/issues/35745/copy" for 127.0.0.1 at 2015-06-23 11:03:23 +0800
Processing by IssuesController#new as HTML
  Parameters: {"project_id"=>"trip_operation", "copy_from"=>"35745"}
  Current user: 88752 (id=239)
  Rendered common/error.html.erb within layouts/base (0.2ms)
  Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_headers.html.erb (0.5ms)
  Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_add_form.html.erb (3.0ms)
Completed 403 Forbidden in 65ms (Views: 12.2ms | ActiveRecord: 8.8ms)

just error record found in the log file, will it affect the entire system?

Clipboard Image Paste breaks KnowledgeBase v3.0.0 plugin installation

Hello,

Clipboard Image Paste is causing errors when installing KnowledgeBase plugin v3.0.0.
I get the following error :
undefined method create_versioned_table'`

I had to comment the following lines to fix this, but of course I'm not getting the KnowledgeBase integration :
File : clipboard_image_paste\lib\clipboard_image_paste\attachment_patch.rb

# KbArticle plug-in (https://github.com/alexbevi/redmine_knowledgebase)
#begin
#  unless KbArticle.included_modules.include? AttachmentPatch
#    KbArticle.send(:include, AttachmentPatch)
#  end
#rescue NameError
#  # plug-in not installed
#end

fresh install with redmine 3.0 ... kbarticle error on migrate

Hello:

I tried installing the plugin with redmine 3.0, and the migrate script fails on a line expecting "kbarticle" to exist, however I do not have the knowledge base plugin installed.

$ rake redmine:plugins:migrate RAILS_ENV=production
rake aborted!
NameError: uninitialized constant KbArticle
/var/data/redmine/plugins/clipboard_image_paste/lib/clipboard_image_paste/attachment_patch.rb:130:in <top (required)>' /var/data/redmine/plugins/clipboard_image_paste/init.rb:33:inblock in <top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:444:in instance_exec' /usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:444:inblock in make_lambda'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:190:in call' /usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:190:inblock in simple'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:502:in call' /usr/local/rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:502:inblock in call'

Cant insert image

We've updated version of Redmine from 2.5 to 3.0.2 and updated this plugin from version 1,8 to 1.10.
Link to plugin is available from new issue but now i cant insert immage with ctrl-v

image

image

NB
while using IE 11 i still have error message
image

Can not simply paste with CTRL-V / should be renamed to show_dialog_and_prevent_paste_of_already_available_image_from_clipboard

Hi, first â big THANK YOU for this plugin, I was very happy to find at least one sane person who implemented this feature without java bloat, which is unusable in 2013 as we all know.

However, I see an interesting clash-of-expections trying this plugin, something every programmer can learn from, I will use this in my lessons as it is a great demonstration of how ideas / expectations / implementations / explanations can collide and produce very different things in human brains, something that programmers are confronted with every day.

I just expected this plugin to enable me to do a CTRL-V in a new issue form to paste the image that is already in the clipboard. But pressing CTRL-V did nothing. Of course I first was looking for some interfering Firefox Addons, disabled all stuff not needed, checked Javascript functionality etc. On second approach I saw the little text below the form "Add picture from clipboard", clicked it and was totally irritated by the upcoming dialog - wait, what does it do? I should press PRT SCRN? WHY, I already have the picture in clipboard, I just want to PASTE it!

In my usecase this is not only a usability issue, but I can not use your plugin for the PASTE part, because I get the screenshots sent by users via Email, so I can not even reproduce the situation the screenshots were taken!

I just copy the screenshots from the email content and would like to paste them in a new issue with CTRL-V - I feel, that this functionality is inside your plugin, but you made it do too much and so it stands in its own way - the situation is kind of funny, the plugin that should enable me to paste images from clipboard is actually preventig me from doing that because it wants to first fill the clipboard itself... ;)

What you think about splitting this up into two plugins - one plugin will keep the name clipboard_image_paste and should do only that, and nothing more: paste images from clipboard.

Then a second plugin could be called make_screenshot_dialog that will offer the dialog that pops up - I am sure that at this stage we will learn, that this dialog makes no sense at all, as usually we do not need a redmine plugin to tell us to press a key on the keyboard...

Certainly there is some obscure reason lying deep in the primitive browser implementations we still have to fight with why you implemented it this way, but can you change this?

Can you make your plugin only do what it is named like, only clipboard_image_paste, not show_dialog_and_prevent_paste_of_already_available_image_from_clipboard?

Maybe you know this aready?
http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/

THANKS!

BTW I can not belive that in 2013 it is still a problem to paste an image from clipboard into a webapp - people like you are the real heros of modern technology, making the most basic functionality available in "modern" web envorinments - if any google or any other big-company-manager is reading this, please give this guy a big budget so we can finally come to sane stage were all expected default features with web browsers are available and users do not have to fight with primitives like "paste image into webapp"!

Cannot Unzip Downloadable Release

I tried downloading the zip files for installing clipboard_image_paste. I get the following error.

unzip master.zip
Archive: master.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of master.zip or
master.zip.zip, and cannot find master.zip.ZIP, period.

unzip v1.8.zip
Archive: v1.8.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of v1.8.zip or
v1.8.zip.zip, and cannot find v1.8.zip.ZIP, period.

Redmine compability

Hello ,

I am using redmine2.5.1 latest version of redmine ,i used clipboard_image_paste plugin for redmine-2.2.4 , now i upgrade redmine when will ready to support redmine2.5.1 , i excepting very needful

failed to install

my bad.. please ignore.. had some other issues which prevented me from installing it.. please close this thread

strange issue about the plugin

I'm not sure why it happened? the error is

An ActionController::UnknownHttpMethod occurred in #:

  , accepted HTTP methods are OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, VERSION-CONTROL, REPORT, CHECKOUT, CHECKIN, UNCHECKOUT, MKWORKSPACE, UPDATE, LABEL, MERGE, BASELINE-CONTROL, MKACTIVITY, ORDERPATCH, ACL, SEARCH, MKCALENDAR, and PATCH



-------------------------------
Request:
-------------------------------

* URL : http://redmine.utranshub.com%2Fplugin_assets%2Fclipboard_image_paste%2Fstylesheets%2Fclipboard_image_paste.css
  * HTTP Method: GET
  * IP address : 192.168.60.239
  * Parameters : {}
  * Timestamp  : 2016-06-14 00:20:32 UTC
  * Server : jira
  * Rails root : /opt/redmine
  * Process: 31594

-------------------------------
Session:
-------------------------------

  * session id: "c49c8937154eb1837165e400b7be0914"
  * data: {"session_id"=>"c49c8937154eb1837165e400b7be0914",
   "_csrf_token"=>"hGqO8t8sy6FcH39+XsCQOU5oB1Y2KsMjodgtlBBNrTU=",
   "recent_projects"=>[]}

-------------------------------
Environment:
-------------------------------

  * GATEWAY_INTERFACE                              : CGI/1.2
  * HTTP_ACCEPT                                    : text/css,*/*;q=0.1
  * HTTP_ACCEPT_ENCODING                           : gzip, deflate
  * HTTP_ACCEPT_LANGUAGE                           : zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
  * HTTP_CONNECTION                                : keep-alive
  * HTTP_COOKIE                                    : theme=black-green; sidebarCookie=show; contentMargin=; _redmine_session=dUVtNVBncUloSy9xMnkxNWoraU5DZ1orcTd4YkkwaW5DNU4vQ3J3N0E1cmo0cG1NU2hPRlVpdHV0SHcvb1B2czRSajJoa0FzSmNsRHVnTERFNFFxMGZpTzhDTlI2TGVLK2UySnlKdzBCNzlSdzlmZ3NkZ01QWURka21OOHFWYm1JMFBZY0c0TkRQZFdEQndzTXJHK0x0OFo3SEYvYW83VTA5QXo0b3ljRjVHRFQwK2ZkRWkreEFmbk5IVHh4YkV5UkhISmk5L2NGR0JiV1FtdUZVdVFJQT09LS05UGx2T3hwTEVVMGZNcWRzd0cwaVFnPT0%3D--b232b3c37e5000d7d194100946ba428adc6c9ff2
  * HTTP_HOST                                      : redmine.utranshub.com
* HTTP_REFERER : http://redmine.utranshub.com/
  * HTTP_USER_AGENT                                : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
  * HTTP_VERSION                                   : HTTP/1.1
  * ORIGINAL_FULLPATH                              : /plugin_assets/clipboard_image_paste/stylesheets/clipboard_image_paste.css
  * ORIGINAL_SCRIPT_NAME                           :
  * PATH_INFO                                      : %2Fplugin_assets%2Fclipboard_image_paste%2Fstylesheets%2Fclipboard_image_paste.css
  * QUERY_STRING                                   :
  * REMOTE_ADDR                                    : 192.168.60.239
  * REQUEST_METHOD                                 : GET
  * REQUEST_PATH                                   : /plugin_assets/clipboard_image_paste/stylesheets/clipboard_image_paste.css
  * REQUEST_URI                                    : /plugin_assets/clipboard_image_paste/stylesheets/clipboard_image_paste.css
  * ROUTES_45843960_SCRIPT_NAME                    :
  * SCRIPT_NAME                                    :
  * SERVER_NAME                                    : redmine.utranshub.com
  * SERVER_PORT                                    : 80
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : thin 1.7.0 codename Dunder Mifflin
  * action_dispatch.backtrace_cleaner              : #<Rails::BacktraceCleaner:0x000000049b2108>
  * action_dispatch.cookies                        : #<ActionDispatch::Cookies::CookieJar:0x007f64c0928278>
  * action_dispatch.cookies_digest                 :
  * action_dispatch.cookies_serializer             :
  * action_dispatch.encrypted_cookie_salt          : encrypted cookie
  * action_dispatch.encrypted_signed_cookie_salt   : signed encrypted cookie
  * action_dispatch.http_auth_salt                 : http authentication
  * action_dispatch.key_generator                  : #<ActiveSupport::CachingKeyGenerator:0x00000005ceefc8>
  * action_dispatch.logger                         : #<Logger:0x0000000593a008>
  * action_dispatch.parameter_filter               : [:password]
  * action_dispatch.redirect_filter                : []
  * action_dispatch.remote_ip                      : 192.168.60.239
  * action_dispatch.request.content_type           :
  * action_dispatch.request.parameters             : {}
  * action_dispatch.request.path_parameters        : {}
  * action_dispatch.request.query_parameters       : {}
  * action_dispatch.request.request_parameters     : {}
  * action_dispatch.request.unsigned_session_cookie: {"session_id"=>"c49c8937154eb1837165e400b7be0914", "_csrf_token"=>"hGqO8t8sy6FcH39+XsCQOU5oB1Y2KsMjodgtlBBNrTU=", "recent_projects"=>[]}
  * action_dispatch.request_id                     : ea7728cf-9cd0-4c73-b463-855230b8b205
  * action_dispatch.routes                         : #<ActionDispatch::Routing::RouteSet:0x00000005770bf0>
  * action_dispatch.secret_key_base                : 0766de1a38458f6ed259d92d32f935a6d1ca6679e6bf4ee258716df9e83186497557be97146359d2
  * action_dispatch.secret_token                   :
  * action_dispatch.show_detailed_exceptions       : false
  * action_dispatch.show_exceptions                : true
  * action_dispatch.signed_cookie_salt             : signed cookie
  * async.callback                                 : #<Method: Thin::Connection#post_process>
  * async.close                                    : #<EventMachine::DefaultDeferrable:0x007f6490961a30>
  * rack.errors                                    : #<IO:0x00000001175588>
  * rack.input                                     : #<StringIO:0x007f64909d26e0>
  * rack.multiprocess                              : false
  * rack.multithread                               : true
  * rack.request.cookie_hash                       : {"theme"=>"black-green", "sidebarCookie"=>"show", "contentMargin"=>"", "_redmine_session"=>"dUVtNVBncUloSy9xMnkxNWoraU5DZ1orcTd4YkkwaW5DNU4vQ3J3N0E1cmo0cG1NU2hPRlVpdHV0SHcvb1B2czRSajJoa0FzSmNsRHVnTERFNFFxMGZpTzhDTlI2TGVLK2UySnlKdzBCNzlSdzlmZ3NkZ01QWURka21OOHFWYm1JMFBZY0c0TkRQZFdEQndzTXJHK0x0OFo3SEYvYW83VTA5QXo0b3ljRjVHRFQwK2ZkRWkreEFmbk5IVHh4YkV5UkhISmk5L2NGR0JiV1FtdUZVdVFJQT09LS05UGx2T3hwTEVVMGZNcWRzd0cwaVFnPT0=--b232b3c37e5000d7d194100946ba428adc6c9ff2"}
  * rack.request.cookie_string                     : theme=black-green; sidebarCookie=show; contentMargin=; _redmine_session=dUVtNVBncUloSy9xMnkxNWoraU5DZ1orcTd4YkkwaW5DNU4vQ3J3N0E1cmo0cG1NU2hPRlVpdHV0SHcvb1B2czRSajJoa0FzSmNsRHVnTERFNFFxMGZpTzhDTlI2TGVLK2UySnlKdzBCNzlSdzlmZ3NkZ01QWURka21OOHFWYm1JMFBZY0c0TkRQZFdEQndzTXJHK0x0OFo3SEYvYW83VTA5QXo0b3ljRjVHRFQwK2ZkRWkreEFmbk5IVHh4YkV5UkhISmk5L2NGR0JiV1FtdUZVdVFJQT09LS05UGx2T3hwTEVVMGZNcWRzd0cwaVFnPT0%3D--b232b3c37e5000d7d194100946ba428adc6c9ff2
  * rack.request.query_hash                        : {}
  * rack.request.query_string                      :
  * rack.run_once                                  : false
  * rack.session                                   : #<ActionDispatch::Request::Session:0x007f64909d1678>
  * rack.session.options                           : #<ActionDispatch::Request::Session::Options:0x007f64909d1628>
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 0]

javascript error

When I click "Add picture from clipboard", there is a javascript error: "Uncaught TypeError: Object [object Object] has no method 'dialog'".

Following are my environment settings:
I install redmine by BitNami
Environment:
Redmine version 2.3.1.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
clipboard_image_paste 1.7
redmine_code_review 0.6.2
redmine_contacts 3.2.4-light
redmine_dashboard 2.0.rc1
redmine_issue_checklist 2.0.5
redmine_latex_mathjax 0.1.0
redmine_people 0.1.6
redmine_questions 0.0.5
redmine_zenedit 0.0.1

add portuguese (brazilian - pt_BR.yml)

pt-BR:
cbp_txt_add_image : 'Adicionar imagem da área de transferência'
cbp_txt_crop_box : 'crop box: x={1} y={2} width={3} height={4}'
cbp_txt_print : 'Usar o PrintScreen e usar o Ctrl+V.'
cbp_txt_select : 'Usar o mouse para selecionar parte da imagem.'
cbp_txt_deselect : 'Clique fora de seleção para desmarcar.'
cbp_txt_empty_cb : 'A área de transferência está vazia. Tente teclar no PrintScreen novamente.'
cbp_txt_no_image_cb : 'Nenhuma imagem encontrada na área de transferência. Tente teclar no PrintScreen novamente.'
cbp_txt_no_image_pst : 'Nenhuma imagem foi colada ainda. Insira alguns primeiro.'
cbp_txt_too_many_files : 'O seu navegador atual nãpode colar fotos. Por favor, use o Mozilla Firefox %{max_attachments}.'
cbp_txt_wrong_browser : 'O seu navegador atual nãpode colar fotos. Por favor, use o Mozilla Firefox ver. >= %{min_firefox_ver} or Google Chrome ver. >= %{min_chrome_ver}.'
cbp_txt_btn_ok : 'Ok'
cbp_txt_btn_cancel : 'Cancelar'
cbp_txt_copy_link : 'Copiar imagem e link miniatura'

'Preview' doesn't display new inlined pictures

uss clipboard_image_paste upload sreenshot image can NOT preview

image

test env

Environment:
  Redmine version                3.0.7.stable
  Ruby version                   2.0.0-p648 (2015-12-16) [x86_64-linux]
  Rails version                  4.2.3
  Environment                    production
  Database adapter               Mysql2

Redmine plugins:
  advanced_roadmap_v2            2.4.2

Functionality failure in Redmine 2.6.0 version

Hi Richard,
This morning I have installed redmine latest version 2.6.0.
After installing clipboard_image_paste plugin, i found an issue regarding its functionality and position in issues page.
Please have a look over attached picture below

image

If possible, please fix this issue since our organization, QA/QC team is highly depending on this functionality.
Same link is again available at bottom of Issues list page.

Regards,
Lajish Lakshmanan

Redmine 3.0

Hello,

is your plugin prepared for Remine 3.0? Do you prepare it?

Adding paste button in the "cbp_link_dlg" dialog box

Hello,
thank you for this great plugin.

I propose you a little addon for more friendly GUI, a button to paste image link or macro thumbnail directly in the wiki edit textarea.

i do not know redmine plugin development and you'll find numbers of errors...

I hope this help you
HelmerFud

here is the code:
file ./assets/javascripts/InsertCodeInTextArea.js

// insert some text in a textarea at caret position
function InsertCodeInTextArea(areaId, textValue) {
    //Get textArea HTML control 
    var txtArea = document.getElementById(areaId);

    //IE
    if (document.selection) {
        txtArea.focus();
        var sel = document.selection.createRange();
        sel.text = textValue;
        return;
    }
    //Firefox, chrome, mozilla
    else if (txtArea.selectionStart || txtArea.selectionStart == '0') {
        var startPos = txtArea.selectionStart;
        var endPos = txtArea.selectionEnd;
        var scrollTop = txtArea.scrollTop;
        txtArea.value = txtArea.value.substring(0, startPos) + textValue + txtArea.value.substring(endPos, txtArea.value.length);
        txtArea.focus();
        txtArea.selectionStart = startPos + textValue.length;
        txtArea.selectionEnd = startPos + textValue.length;
    }
    else {
        txtArea.value += textArea.value;
        txtArea.focus();
    }
}
diff --git a/app/views/clipboard_image_paste/_add_form.html.erb b/app/views/clipboard_image_paste/_add_form.html.erb
index a0f48da..cebe196 100644
--- a/app/views/clipboard_image_paste/_add_form.html.erb
+++ b/app/views/clipboard_image_paste/_add_form.html.erb
@@ -54,11 +54,15 @@
 <!-- dialog to copy image link for wiki -->
 <div id="cbp_link_dlg" title="<%= l(:cbp_txt_copy_link) %>" style="display:none">
   <input type="text" id="cbp_image_link" readonly />
+  &nbsp;
+  <a class="icon icon-copy" onclick="InsertCodeInTextArea('content_text', document.getElementById('cbp_image_link').value);$(cbp_link_dlg).dialog('close');">Copy</a>
   <%
     if $clipboard_image_paste_has_jquery
   %>
   <p/>
   <input type="text" id="cbp_thumbnail_link" readonly />
+  &nbsp;
+  <a class="icon icon-copy" onclick="InsertCodeInTextArea('content_text', document.getElementById('cbp_image_link').value);$(cbp_link_dlg).dialog('close');">Copy</a>
   <%
     end
   %>
diff --git a/app/views/clipboard_image_paste/_headers.html.erb b/app/views/clipboard_image_paste/_headers.html.erb
index 722e9e9..063b0cc 100644
--- a/app/views/clipboard_image_paste/_headers.html.erb
+++ b/app/views/clipboard_image_paste/_headers.html.erb
@@ -11,6 +11,7 @@
 %>
 <%= javascript_include_tag 'jcrop-0.9.10.min.js',         :plugin => 'clipboard_image_paste' %>
 <%= javascript_include_tag 'clipboard_image_paste.js',    :plugin => 'clipboard_image_paste' %>
+<%= javascript_include_tag 'InsertCodeInTextArea.js',     :plugin => 'clipboard_image_paste' %>
 <%
   if !$clipboard_image_paste_has_jquery
 %>

Why this plugin's image can't be exported in wiki PDF

I've install clipboard_image_paste plugin in redmine.

And I add image in wiki page through two ways:

  1. upload file
  2. paste to plugin

Both images are display successfully in wiki page, but when I export PDF, only the image I uploaded displayed, the image by this plugin not display. Is it a different ways to load and display the images for clipboard_image_paste plugin?

Not working on 2.6 and I don't no why.

After inserting image from clipboard, cropping and clicking on "Ok" button - nothing happens. Image still show in popup.
In apache and Redmine logs all clear.
I have captured traffic from browser to Redmine - and there are no activity when I click Ok.
I tried FF 34 and Google Chrome 39 on Windows 7 with Redmine 2.6.0 with plugins:
Clipboard image paste;
Global Roles plugin;
Redmine LDAP Sync;
Redmine People plugin;
Redmine SSO plugin.

RoutingError (No route matches [OPTIONS] "/plugin_assets/clipboard_image_paste/stylesheets"

Hi!

We are on redmine 3.3. and using v1.10 of your plugin. It works great but usage throws in the redmine-logfile following error:
ActionController::RoutingError (No route matches [OPTIONS] "/plugin_assets/clipboard_image_paste/stylesheets"): actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in call'

(and so on).

But nevertheless it works. The "stylesheets" folder is located in the subfolder "assets" (and not plugin_assets) and thus cannot be found by this route.

Existing folder: /opt/redmine/redmine/plugins/clipboard_image_paste/assets

Is there any need or way to fix that? Can we simply rename "assets" to "plugin_assets" or does this break something else:

Thanks a lot

B4E

Internal error

I got "Internal error" on the start page of redmine 2.2.1 with you plugin. Did you test this? Help please...

Best regards

uninitialized constant KbArticle

Installed in 3.0.1 and ran rake:

NameError: uninitialized constant KbArticle

/usr/share/redmine-3.0.1/plugins/clipboard_image_paste-1.9/lib/clipboard_image_paste/attachment_patch.rb:130:in <top (required)>' /usr/share/redmine-3.0.1/plugins/clipboard_image_paste-1.9/init.rb:33:inblock in <top (required)>'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:441:in instance_exec' /var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:441:inblock in make_lambda'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:189:in call' /var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:189:inblock in simple'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:190:in call' /var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:190:inblock in simple'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in call' /var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in_run_callbacks'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in _run_prepare_callbacks' /var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:inrun_callbacks'
/var/lib/gems/1.9.1/gems/actionpack-4.2.0/lib/action_dispatch/middleware/reloader.rb:83:in prepare!' /var/lib/gems/1.9.1/gems/actionpack-4.2.0/lib/action_dispatch/middleware/reloader.rb:55:inprepare!'
/var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/application/finisher.rb:50:in block in <module:Finisher>' /var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:ininstance_exec'
/var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:in run' /var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:55:inblock in run_initializers'
/var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:54:in run_initializers' /var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/application.rb:352:ininitialize!'
/usr/share/redmine-3.0.1/config/environment.rb:14:in <top (required)>' /var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/application.rb:328:inrequire_environment!'
/var/lib/gems/1.9.1/gems/railties-4.2.0/lib/rails/application.rb:443:in `block in run_tasks_blocks'
Tasks: TOP => redmine:plugins:migrate => environment

Unable to paste images copied from Outlook 2010

It seems that images copied from a Mail (out of Outlook 2010) cannot be pasted (nothing happens).
But If I paste the same image into Word (2010) and copy it there again, then I can paste it into clipboard_image_paste plugin.
(I am using Chrome 36)

double name for pasted image

in an issue with a lot (10+) images a double in the proposed picture names occurred (picture648-1.png).

The issue showed only the later attached image - even where the first attached image was shown before.

both images under the same name could be deleted seperately and reattached under different names, so no trouble there - only a user got a little confused.

since the 3 digit number seems to be randomly generated every time an issue is edited, such a collision is inevitable to happen sometime.

Maybe a short test could be implemented, that gives the user a warning: "image with that name already attached!"

Error occurred with Version 1.10 of the plugin.

Firefox 22 (released this week): pasteHandler in clipboard_image_paste.js runs into if-block for Chrome and fails on that

With Firefox 22 the event.clipBoardData object was implemented, but - as far as I could find out - in a different way than in Chrome.
It seems that e.clipboardData.items (line 344 and following in clipboard_image_paste.js) is undefined in Firefox 22. The further code then fails.

I did a quick hack and modified our local copy in line 342 this way:
if (e.clipboardData && e.clipboardData.mozItemCount == undefined) {

This forces Firefox to execute the else-Block again (like in before 22 versions).

I know, this is only a quick and not a final solution, but we need that plugin working every day.
At least I wanted to let you know about this new issue.

Thank you for this great plugin!

Problems with Redmine 2.5.2

I´m running Redmine on debian-jessie. Installation via apt-get.

Environment:
Redmine version 2.5.2.devel
Ruby version 2.1.5-p273 (2014-11-13) [x86_64-linux-gnu]
Rails version 4.1.8
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.10
Filesystem
Redmine plugins:
clipboard_image_paste 1.10

I did the following:

  1. Create folder "/usr/share/redmine/plugins"
  2. unzip the 1.10 plugin to it
  3. restart apache

Now i got the same behavior like here . (Button showed at the bottom)
After clicking IE 11 Debugger says object doesnt support the method cbImagePaste.showPasteDialog()

Did I forgot something?

Compatibility witk CKEditor plugin

Please could you make this change (add compatibility with ckeditor plugin)

Inside clipboard_image_paste.js, add the function:

// Add createObjectURL function
function createObjectURL ( file ) {
if ( window.webkitURL ) {
return window.webkitURL.createObjectURL( file );
} else if ( window.URL && window.URL.createObjectURL ) {
return window.URL.createObjectURL( file );
} else {
return null;
}
};

And use the function insdide pasteHandler:

// Handle paste events
function pasteHandler(e) {
// We need to check if event.clipboardData is supported (Chrome)
if (hasClipboard && e.clipboardData) {
// Get the items from the clipboard
var items = e.clipboardData.items;
if (!items)
alert(cbImagePaste.cbp_txt_empty_cb);
else {
// Loop through all items, looking for any kind of image
for (var i = 0; i < items.length; i++) {
if (items[i].type.indexOf("image") !== -1) {
// We need to represent the image as a file,
var blob = items[i].getAsFile();
// and use a URL or webkitURL (whichever is available to the browser)
// to create a temporary URL to the object
//***********************************************************
var source = createObjectURL(blob);
//***********************************************************
// The URL can then be used as the source of an image
createImage(source);
return;
}
}
alert(cbImagePaste.cbp_txt_no_image_cb);
}
// If we can't handle clipboard data directly (Firefox),
// we need to read what was pasted from the contenteditable element
} else {
// This is a cheap trick to make sure we read the data
// AFTER it has been inserted.
setTimeout(checkInput, 1);
}
};

This patch works with textile and ckeditor

Italian translation

Italian strings go here

it:
cbp_txt_add_image : 'Aggiungi immagine dalla clipboard'
cbp_txt_crop_box : 'crop box: x={1} y={2} width={3} height={4}'
cbp_txt_print : 'Usa il tasto PrintScreen e poi Ctrl+V.'
cbp_txt_select : "Usa il mouse per selezionare parti specifiche dell'immagine."
cbp_txt_deselect : 'Click fuori dalla selezione per deselezionare.'
cbp_txt_empty_cb : 'La clipboard è vuota. Prova a ripremere il tasto PrintScreen.'
cbp_txt_no_image_cb : 'Nessuna immagine trovata nella clipboard. Prova a premere nuovamente PrintScreen.'
cbp_txt_no_image_pst : 'Nessuna immagine è stata ancora incollata. Inseriscine prima qualcuna.'
cbp_txt_too_many_files : 'Impossibile aggiungere altri allegati. Il numero massimo di allegati ammesso è %{max_attachments}.'
cbp_txt_wrong_browser : 'Il tuo browser non è in grado di incollare immagini. Per cortesia usa Mozilla Firefox ver. >= %{min_firefox_ver} oppure Google Chrome ver. >= %{min_chrome_ver}.'
cbp_txt_btn_ok : 'Ok'
cbp_txt_btn_cancel : 'Annulla'
cbp_txt_copy_link : 'Copia immagine e collegamento a miniatura'

Broken in FF 27

Hi
I am getting a javascript error in FF 27. The console tells me:

SecurityError: The operation is insecure.
return dst.toDataURL("image/png");

Gives an error in redmine 2.3.0 (Windows Bitnami installer)

Hi,

I try to install the plugin and it gives an error:
I have downloaded the last build from master (5 minutes ago), I can see the "es" locale file inside. Redmine gives an internal error and this is what I can see in the logs:

ActionView::Template::Error (Missing partial clipboard_image_paste/headers with {:locale=>[:es, :en], :formats=>[:html], :handlers=>[:erb, :builder, :rsb]}. Searched in:

  • "C:/BitNami/redmine-2.3.0-2/apps/redmine/htdocs/app/views"
    ):
    11: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
    12: <%= javascript_heads %>
    13: <%= heads_for_theme %>
    14: <%= call_hook :view_layouts_base_html_head %>
    15:
    16: <%= yield :header_tags -%>
    17:
    lib/redmine/hook.rb:111:in block in render_on' lib/redmine/hook.rb:61:inblock (2 levels) in call_hook'
    lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:inblock in call_hook'
    lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:incall_hook'
    lib/redmine/hook.rb:158:in call_hook' app/views/layouts/base.html.erb:14:in_app_views_layouts_base_html_erb__594165166_32771004'
    app/controllers/application_controller.rb:397:in block (2 levels) in render_error' app/controllers/application_controller.rb:395:inrender_error'
    app/controllers/application_controller.rb:383:in render_404' app/controllers/application_controller.rb:407:inmissing_template'

Compatibility with redmine_latex_mathjax

Now, 17.12.2016, clipboard_image_paste IS compatible with redmine_latex_mathjax 0.3.0
Tested in this environment:

Environment:
Redmine version 3.3.1.stable
Ruby version 2.3.3-p222 (2016-11-21) [i386-mingw32]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.9.5
Filesystem
Redmine plugins:
clipboard_image_paste 1.10
redmine_code_review 0.7.0
redmine_latex_mathjax_macro 0.3.0
redmine_theme_changer 0.2.0
sidebar_hide 0.0.6

Firefox 52 error: TypeError: a.browser is undefined (jcrop-0.9.10.min.js:11:446)

With the new Firefox 52 release the plugin stopped functioning and I get the following error every time I want to paste:

TypeError: a.browser is undefined[Learn More] jcrop-0.9.10.min.js:11:446
	a.Jcrop https://server/redmine/plugin_assets/clipboard_image_paste/javascripts/jcrop-0.9.10.min.js:11:446
	a.fn.Jcrop/< https://server/redmine/plugin_assets/clipboard_image_paste/javascripts/jcrop-0.9.10.min.js:21:266
	.each https://server/redmine/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:2:2971
	m.prototype.each https://server/redmine/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js:2:833
	a.fn.Jcrop https://server/redmine/plugin_assets/clipboard_image_paste/javascripts/jcrop-0.9.10.min.js:20:959
	createPanel https://server/redmine/plugin_assets/clipboard_image_paste/javascripts/clipboard_image_paste.js:224:5
	createImage/pastedImage.onload https://server/redmine/plugin_assets/clipboard_image_paste/javascripts/clipboard_image_paste.js:405:7

Plans to add functionality to highlight areas on screenshots?

Dear developers, your plugin is great, big-big thanks for it!!!
According to my experience, most of users, in 99% "pre-process" screenshots in Paint / Windows Snipping Tool - highlight some area, crop - and copy to Redmine. Your plugin can crop images, but it can't highlight. So, if you will add simplest possible highlighting functionality, I think many users will be really happy. Something simple-simple - like to draw rectangle - and settings - choose color and line width - and that's all, it will cover almost all requirements for screenshots edit!

Thanks in advance!!

Export to PDF

The image captured are 32bit depth and PDF export does not support it, is it possible to configure bit depth?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.