smart_editor 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/smart_editor/application.js +15 -0
  5. data/app/assets/javascripts/smart_editor/editor_images.js +1 -0
  6. data/app/assets/stylesheets/smart_editor/application.css +13 -0
  7. data/app/assets/stylesheets/smart_editor/editor_images.css +4 -0
  8. data/app/controllers/smart_editor/application_controller.rb +4 -0
  9. data/app/controllers/smart_editor/editor_images_controller.rb +41 -0
  10. data/app/helpers/smart_editor/application_helper.rb +4 -0
  11. data/app/helpers/smart_editor/editor_images_helper.rb +4 -0
  12. data/app/models/smart_editor/editor_image.rb +7 -0
  13. data/app/uploaders/file_uploader.rb +55 -0
  14. data/app/views/layouts/smart_editor/application.html.erb +14 -0
  15. data/app/views/smart_editor/editor_images/index.html.erb +4 -0
  16. data/config/routes.rb +7 -0
  17. data/db/migrate/20130101074444_create_smart_editor_editor_images.rb +10 -0
  18. data/lib/generators/smart_editor/smart_editor_generator.rb +18 -0
  19. data/lib/generators/smart_editor/templates/public/smart_editor/SmartEditor2Skin.html +635 -0
  20. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/FileUploader.php +22 -0
  21. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/FileUploader_html5.php +25 -0
  22. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/Photo_Quick_UploadPopup.html +100 -0
  23. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/QuickPhotoPopup.js +675 -0
  24. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/callback.html +32 -0
  25. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/jindo.min.js +12686 -0
  26. data/lib/generators/smart_editor/templates/public/smart_editor/popup/quick_photo/jindo_fileUpload.js +390 -0
  27. data/lib/generators/smart_editor/templates/public/smart_editor/smart_editor2_inputarea.html +9 -0
  28. data/lib/generators/smart_editor/templates/public/smart_editor/smart_editor2_inputarea_ie8.html +10 -0
  29. data/lib/smart_editor/class_methods.rb +10 -0
  30. data/lib/smart_editor/engine.rb +5 -0
  31. data/lib/smart_editor/form_builder.rb +11 -0
  32. data/lib/smart_editor/version.rb +3 -0
  33. data/lib/smart_editor.rb +18 -0
  34. data/lib/tasks/smart_editor_tasks.rake +4 -0
  35. data/test/dummy/README.rdoc +261 -0
  36. data/test/dummy/Rakefile +7 -0
  37. data/test/dummy/app/assets/javascripts/application.js +16 -0
  38. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  39. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  40. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  41. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  42. data/test/dummy/app/controllers/application_controller.rb +3 -0
  43. data/test/dummy/app/controllers/posts_controller.rb +85 -0
  44. data/test/dummy/app/helpers/application_helper.rb +2 -0
  45. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  46. data/test/dummy/app/models/post.rb +4 -0
  47. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  48. data/test/dummy/app/views/posts/_form.html.erb +30 -0
  49. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  50. data/test/dummy/app/views/posts/index.html.erb +27 -0
  51. data/test/dummy/app/views/posts/new.html.erb +5 -0
  52. data/test/dummy/app/views/posts/show.html.erb +20 -0
  53. data/test/dummy/config/application.rb +59 -0
  54. data/test/dummy/config/boot.rb +10 -0
  55. data/test/dummy/config/database.yml +25 -0
  56. data/test/dummy/config/environment.rb +5 -0
  57. data/test/dummy/config/environments/development.rb +37 -0
  58. data/test/dummy/config/environments/production.rb +67 -0
  59. data/test/dummy/config/environments/test.rb +37 -0
  60. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  61. data/test/dummy/config/initializers/inflections.rb +15 -0
  62. data/test/dummy/config/initializers/mime_types.rb +5 -0
  63. data/test/dummy/config/initializers/secret_token.rb +7 -0
  64. data/test/dummy/config/initializers/session_store.rb +8 -0
  65. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  66. data/test/dummy/config/locales/en.yml +5 -0
  67. data/test/dummy/config/routes.rb +7 -0
  68. data/test/dummy/config.ru +4 -0
  69. data/test/dummy/db/development.sqlite3 +0 -0
  70. data/test/dummy/db/migrate/20130103085542_create_posts.rb +11 -0
  71. data/test/dummy/db/migrate/20130103090021_create_smart_editor_editor_images.smart_editor.rb +11 -0
  72. data/test/dummy/db/schema.rb +32 -0
  73. data/test/dummy/log/development.log +713 -0
  74. data/test/dummy/public/404.html +26 -0
  75. data/test/dummy/public/422.html +26 -0
  76. data/test/dummy/public/500.html +25 -0
  77. data/test/dummy/public/favicon.ico +0 -0
  78. data/test/dummy/public/smart_editor/SmartEditor2Skin.html +635 -0
  79. data/test/dummy/public/smart_editor/popup/quick_photo/FileUploader.php +22 -0
  80. data/test/dummy/public/smart_editor/popup/quick_photo/FileUploader_html5.php +25 -0
  81. data/test/dummy/public/smart_editor/popup/quick_photo/Photo_Quick_UploadPopup.html +100 -0
  82. data/test/dummy/public/smart_editor/popup/quick_photo/QuickPhotoPopup.js +675 -0
  83. data/test/dummy/public/smart_editor/popup/quick_photo/callback.html +32 -0
  84. data/test/dummy/public/smart_editor/popup/quick_photo/jindo.min.js +12686 -0
  85. data/test/dummy/public/smart_editor/popup/quick_photo/jindo_fileUpload.js +390 -0
  86. data/test/dummy/public/smart_editor/smart_editor2_inputarea.html +9 -0
  87. data/test/dummy/public/smart_editor/smart_editor2_inputarea_ie8.html +10 -0
  88. data/test/dummy/script/rails +6 -0
  89. data/test/dummy/test/fixtures/posts.yml +11 -0
  90. data/test/dummy/test/functional/posts_controller_test.rb +49 -0
  91. data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
  92. data/test/dummy/test/unit/post_test.rb +7 -0
  93. data/test/dummy/tmp/cache/assets/C39/A20/sprockets%2Fd75302feb7958c52568020a888775667 +0 -0
  94. data/test/dummy/tmp/cache/assets/C8B/9F0/sprockets%2F42090f88c5061f72460d7c83a9bc8990 +0 -0
  95. data/test/dummy/tmp/cache/assets/C8E/A60/sprockets%2F74b1945f4d4a322ab567f73798c32838 +0 -0
  96. data/test/dummy/tmp/cache/assets/CD4/040/sprockets%2F7c241e3470f7210ab843c109c9d68a4b +0 -0
  97. data/test/dummy/tmp/cache/assets/CE3/740/sprockets%2F200278c67b4dde839345d7b018fed561 +0 -0
  98. data/test/dummy/tmp/cache/assets/CEE/680/sprockets%2F6d653ad72aed952816dd79e63c761417 +0 -0
  99. data/test/dummy/tmp/cache/assets/D12/CA0/sprockets%2Fcd507925f6bb1f62170d028ca668ad98 +0 -0
  100. data/test/dummy/tmp/cache/assets/D13/8A0/sprockets%2Fec89fa303e9609b18f50b6de2831433e +0 -0
  101. data/test/dummy/tmp/cache/assets/D6F/A80/sprockets%2F8893ca0d5d16eb3d85c0964bdbbe3381 +0 -0
  102. data/test/dummy/tmp/cache/assets/D86/AF0/sprockets%2Fcfa5f1244012fcd263cee551afe412b2 +0 -0
  103. data/test/dummy/tmp/cache/assets/D92/5A0/sprockets%2Fb0e45a13b900ecbf7011b78bdff2595e +0 -0
  104. data/test/dummy/tmp/cache/assets/D9D/950/sprockets%2F65093fff17b1aa3bed7e0dda53563b79 +0 -0
  105. data/test/dummy/tmp/cache/assets/DF9/8C0/sprockets%2Fc27a71cbee6a5dffdc2534b267b2fa66 +0 -0
  106. data/test/dummy/tmp/cache/assets/E54/F60/sprockets%2Ff1bba5cc065ebbb83addfbba59f82059 +0 -0
  107. data/test/fixtures/smart_editor/editor_images.yml +11 -0
  108. data/test/functional/smart_editor/editor_images_controller_test.rb +9 -0
  109. data/test/integration/navigation_test.rb +10 -0
  110. data/test/smart_editor_test.rb +7 -0
  111. data/test/test_helper.rb +15 -0
  112. data/test/unit/helpers/smart_editor/editor_images_helper_test.rb +6 -0
  113. data/test/unit/smart_editor/editor_image_test.rb +9 -0
  114. data/vendor/assets/images/smart_editor/bg_b1.png +0 -0
  115. data/vendor/assets/images/smart_editor/bg_find_h3.gif +0 -0
  116. data/vendor/assets/images/smart_editor/bg_line1.gif +0 -0
  117. data/vendor/assets/images/smart_editor/bg_quote2.gif +0 -0
  118. data/vendor/assets/images/smart_editor/bg_set.gif +0 -0
  119. data/vendor/assets/images/smart_editor/bg_tool2.gif +0 -0
  120. data/vendor/assets/images/smart_editor/btn_set.png +0 -0
  121. data/vendor/assets/images/smart_editor/bx_set_110302.gif +0 -0
  122. data/vendor/assets/images/smart_editor/editor_guideline_698.gif +0 -0
  123. data/vendor/assets/images/smart_editor/editor_guideline_890.gif +0 -0
  124. data/vendor/assets/images/smart_editor/icon_set.gif +0 -0
  125. data/vendor/assets/images/smart_editor/photoQuickPopup/bg_drag_image.png +0 -0
  126. data/vendor/assets/images/smart_editor/photoQuickPopup/btn_cancel.png +0 -0
  127. data/vendor/assets/images/smart_editor/photoQuickPopup/btn_confirm.png +0 -0
  128. data/vendor/assets/images/smart_editor/photoQuickPopup/btn_confirm2.png +0 -0
  129. data/vendor/assets/images/smart_editor/photoQuickPopup/btn_del.png +0 -0
  130. data/vendor/assets/images/smart_editor/photoQuickPopup/btn_find.png +0 -0
  131. data/vendor/assets/images/smart_editor/text_tool_set.png +0 -0
  132. data/vendor/assets/images/smart_editor/text_tool_set2.png +0 -0
  133. data/vendor/assets/javascripts/smart_editor/HuskyEZCreator.js +133 -0
  134. data/vendor/assets/javascripts/smart_editor/SE2B_Configuration.js +77 -0
  135. data/vendor/assets/javascripts/smart_editor/SE2BasicCreator.js +85 -0
  136. data/vendor/assets/javascripts/smart_editor/hp_SE2M_AttachQuickPhoto.js +106 -0
  137. data/vendor/assets/javascripts/smart_editor/jindo.min.js +12699 -0
  138. data/vendor/assets/javascripts/smart_editor/jindo_component.js +279 -0
  139. data/vendor/assets/javascripts/smart_editor/loader-min.js +120 -0
  140. data/vendor/assets/javascripts/smart_editor.js +21 -0
  141. data/vendor/assets/stylesheets/smart_editor/smart_editor2.css +262 -0
  142. data/vendor/assets/stylesheets/smart_editor/smart_editor2_in.css +20 -0
  143. data/vendor/assets/stylesheets/smart_editor/smart_editor2_items.css +454 -0
  144. data/vendor/assets/stylesheets/smart_editor/smart_editor2_out.css +24 -0
  145. metadata +331 -0
@@ -0,0 +1,22 @@
1
+ <?php
2
+ //기본 리다이렉트
3
+ echo $_REQUEST["htImageInfo"];
4
+
5
+ $url = $_REQUEST["callback"] .'?callback_func='. $_REQUEST["callback_func"];
6
+ $bSuccessUpload = is_uploaded_file($_FILES['Filedata']['tmp_name']);
7
+ if (bSuccessUpload) { //성공 시 파일 사이즈와 URL 전송
8
+
9
+ $tmp_name = $_FILES['Filedata']['tmp_name'];
10
+ $name = $_FILES['Filedata']['name'];
11
+ $new_path = "../upload/".urlencode($_FILES['Filedata']['name']);
12
+ @move_uploaded_file($tmp_name, $new_path);
13
+ $url .= "&bNewLine=true";
14
+ $url .= "&sFileName=".urlencode(urlencode($name));
15
+ //$url .= "&size=". $_FILES['Filedata']['size'];
16
+ //아래 URL을 변경하시면 됩니다.
17
+ $url .= "&sFileURL=http://test.naver.com/popup/upload/".urlencode(urlencode($name));
18
+ } else { //실패시 errstr=error 전송
19
+ $url .= '&errstr=error';
20
+ }
21
+ header('Location: '. $url);
22
+ ?>
@@ -0,0 +1,25 @@
1
+ <?php
2
+ $sFileInfo = '';
3
+ $headers = array();
4
+ foreach ($_SERVER as $k => $v){
5
+
6
+ if(substr($k, 0, 9) == "HTTP_FILE"){
7
+ $k = substr(strtolower($k), 5);
8
+ $headers[$k] = $v;
9
+ }
10
+ }
11
+
12
+ $file = new stdClass;
13
+ $file->name = rawurldecode($headers['file_name']);
14
+ $file->size = $headers['file_size'];
15
+ $file->content = file_get_contents("php://input");
16
+
17
+ $newPath = '../upload/'.iconv("utf-8", "cp949", $file->name);
18
+
19
+ if(file_put_contents($newPath, $file->content)) {
20
+ $sFileInfo .= "&bNewLine=true";
21
+ $sFileInfo .= "&sFileName=".$file->name;
22
+ $sFileInfo .= "&sFileURL=http://test.naver.com/popup/upload/".$file->name;
23
+ }
24
+ echo $sFileInfo;
25
+ ?>
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html lang="ko">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <meta http-equiv="Content-Script-Type" content="text/javascript">
6
+ <meta http-equiv="Content-Style-Type" content="text/css">
7
+ <title>사진 첨부하기 :: SmartEditor2</title>
8
+ <style type="text/css">
9
+ /* NHN Web Standard 1Team JJS 120106 */
10
+ /* Common */
11
+ body,p,h1,h2,h3,h4,h5,h6,ul,ol,li,dl,dt,dd,table,th,td,form,fieldset,legend,input,textarea,button,select{margin:0;padding:0}
12
+ body,input,textarea,select,button,table{font-family:'돋움',Dotum,Helvetica,sans-serif;font-size:12px}
13
+ img,fieldset{border:0}
14
+ ul,ol{list-style:none}
15
+ em,address{font-style:normal}
16
+ a{text-decoration:none}
17
+ a:hover,a:active,a:focus{text-decoration:underline}
18
+
19
+ /* Contents */
20
+ .blind{visibility:hidden;position:absolute;line-height:0}
21
+ #pop_wrap{width:383px}
22
+ #pop_header{height:26px;padding:14px 0 0 20px;border-bottom:1px solid #ededeb;background:#f4f4f3}
23
+ .pop_container{padding:11px 20px 0}
24
+ #pop_footer{margin:21px 20px 0;padding:10px 0 16px;border-top:1px solid #e5e5e5;text-align:center}
25
+ h1{color:#333;font-size:14px;letter-spacing:-1px}
26
+ .btn_area{word-spacing:2px}
27
+ .pop_container .drag_area{overflow:hidden;overflow-y:auto;position:relative;width:341px;height:129px;margin-top:4px;border:1px solid #eceff2}
28
+ .pop_container .drag_area .bg{display:block;position:absolute;top:0;left:0;width:341px;height:129px;background:#fdfdfd url(/assets/smart_editor/photoQuickPopup/bg_drag_image.png) 0 0 no-repeat}
29
+ .pop_container .nobg{background:none}
30
+ .pop_container .bar{color:#e0e0e0}
31
+ .pop_container .lst_type li{overflow:hidden;position:relative;padding:7px 0 6px 8px;border-bottom:1px solid #f4f4f4;vertical-align:top}
32
+ .pop_container :root .lst_type li{padding:6px 0 5px 8px}
33
+ .pop_container .lst_type li span{float:left;color:#222}
34
+ .pop_container .lst_type li em{float:right;margin-top:1px;padding-right:22px;color:#a1a1a1;font-size:11px}
35
+ .pop_container .lst_type li a{position:absolute;top:6px;right:5px}
36
+ .pop_container .dsc{margin-top:6px;color:#666;line-height:18px}
37
+ .pop_container .dsc_v1{margin-top:12px}
38
+ .pop_container .dsc em{color:#13b72a}
39
+ .pop_container2{padding:46px 60px 20px}
40
+ .pop_container2 .dsc{margin-top:6px;color:#666;line-height:18px}
41
+ .pop_container2 .dsc strong{color:#13b72a}
42
+ .upload{margin:0 4px 0 0;_margin:0;padding:6px 0 4px 6px;border:solid 1px #d5d5d5;color:#a1a1a1;font-size:12px;border-right-color:#efefef;border-bottom-color:#efefef;length:300px;}
43
+ :root .upload{padding:6px 0 2px 6px;}
44
+ </style>
45
+ </head>
46
+ <body>
47
+ <div id="pop_wrap">
48
+ <!-- header -->
49
+ <div id="pop_header">
50
+ <h1>사진 첨부하기</h1>
51
+ </div>
52
+ <!-- //header -->
53
+ <!-- container -->
54
+
55
+ <!-- [D] HTML5인 경우 pop_container 클래스와 하위 HTML 적용
56
+ 그밖의 경우 pop_container2 클래스와 하위 HTML 적용 -->
57
+ <div id="pop_container2" class="pop_container2">
58
+ <!-- content -->
59
+ <form id="editor_image" name="editor_image" action="/smart_editor/editor_images/create_without_html5" method="post" enctype="multipart/form-data" onSubmit="return false;">
60
+ <div id="pop_content2">
61
+ <input type="file" class="upload" id="editor_image_file" name="editor_image[file]">
62
+ <p class="dsc" id="info"><strong>10MB</strong>이하의 이미지 파일만 등록할 수 있습니다.<br>(JPG, GIF, PNG, BMP)</p>
63
+ </div>
64
+ </form>
65
+ <!-- //content -->
66
+ </div>
67
+ <div id="pop_container" class="pop_container" style="display:none;">
68
+ <!-- content -->
69
+ <div id="pop_content">
70
+ <p class="dsc"><em id="imageCountTxt">0장</em>/10장 <span class="bar">|</span> <em id="totalSizeTxt">0MB</em>/50MB</p>
71
+ <!-- [D] 첨부 이미지 여부에 따른 Class 변화
72
+ 첨부 이미지가 있는 경우 : em에 "bg" 클래스 적용 //첨부 이미지가 없는 경우 : em에 "nobg" 클래스 적용 -->
73
+
74
+ <div class="drag_area" id="drag_area">
75
+ <ul class="lst_type" >
76
+ </ul>
77
+ <em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg"></span>
78
+ </div>
79
+ <div style="display:none;" id="divImageList"></div>
80
+ <p class="dsc dsc_v1"><em>한 장당 10MB, 1회에 50MB까지, 10개</em>의 이미지 파일을<br>등록할 수 있습니다. (JPG, GIF, PNG, BMP)</p>
81
+ </div>
82
+ <!-- //content -->
83
+ </div>
84
+
85
+ <!-- //container -->
86
+ <!-- footer -->
87
+ <div id="pop_footer">
88
+ <div class="btn_area">
89
+ <a href="#"><img src="/assets/smart_editor/photoQuickPopup/btn_confirm.png" width="49" height="28" alt="확인" id="btn_confirm"></a>
90
+ <a href="#"><img src="/assets/smart_editor/photoQuickPopup/btn_cancel.png" width="48" height="28" alt="취소" id="btn_cancel"></a>
91
+ </div>
92
+ </div>
93
+ <!-- //footer -->
94
+ </div>
95
+ <script type="text/javascript" src="jindo.min.js" charset="utf-8"></script>
96
+ <script type="text/javascript" src="jindo_fileUpload.js" charset="utf-8"></script>
97
+ <script type="text/javascript" src="QuickPhotoPopup.js" charset="utf-8"></script>
98
+
99
+ </body>
100
+ </html>