koda 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/lib/helpers/app_helper.rb +40 -0
  2. data/lib/helpers/koda_helper.rb +105 -0
  3. data/lib/helpers/view_helper.rb +146 -0
  4. data/lib/koda.rb +123 -0
  5. data/lib/models/hash.rb +29 -0
  6. data/lib/models/mongo_collection.rb +144 -0
  7. data/lib/models/mongo_config.rb +22 -0
  8. data/lib/models/mongo_database.rb +136 -0
  9. data/lib/models/mongo_document.rb +124 -0
  10. data/lib/models/mongo_grid.rb +85 -0
  11. data/lib/models/mongo_media.rb +55 -0
  12. data/lib/models/user_access_provider.rb +135 -0
  13. data/lib/models/user_context.rb +19 -0
  14. data/lib/routes/koda_api.rb +392 -0
  15. data/lib/routes/koda_site.rb +57 -0
  16. data/lib/views/console.erb +139 -0
  17. data/lib/views/explorer.erb +119 -0
  18. data/lib/views/login.erb +77 -0
  19. data/lib/views/not_allowed.erb +75 -0
  20. data/public/koda/Help/DataTypes.txt +82 -0
  21. data/public/koda/Help/KodaType_Template.js +48 -0
  22. data/public/koda/apple-touch-icon-114x114-precomposed.png +0 -0
  23. data/public/koda/apple-touch-icon-144x144-precomposed.png +0 -0
  24. data/public/koda/apple-touch-icon-57x57-precomposed.png +0 -0
  25. data/public/koda/apple-touch-icon-72x72-precomposed.png +0 -0
  26. data/public/koda/apple-touch-icon-precomposed.png +0 -0
  27. data/public/koda/apple-touch-icon.png +0 -0
  28. data/public/koda/css/bootstrap-responsive.css +1058 -0
  29. data/public/koda/css/bootstrap.css +5774 -0
  30. data/public/koda/css/main.css +288 -0
  31. data/public/koda/favicon.ico +0 -0
  32. data/public/koda/fonts/angelina-webfont.eot +0 -0
  33. data/public/koda/fonts/angelina-webfont.svg +228 -0
  34. data/public/koda/fonts/angelina-webfont.ttf +0 -0
  35. data/public/koda/fonts/angelina-webfont.woff +0 -0
  36. data/public/koda/fonts/coolvetica_rg-webfont.eot +0 -0
  37. data/public/koda/fonts/coolvetica_rg-webfont.svg +232 -0
  38. data/public/koda/fonts/coolvetica_rg-webfont.ttf +0 -0
  39. data/public/koda/fonts/coolvetica_rg-webfont.woff +0 -0
  40. data/public/koda/fonts/ladyic__-webfont.eot +0 -0
  41. data/public/koda/fonts/ladyic__-webfont.svg +257 -0
  42. data/public/koda/fonts/ladyic__-webfont.ttf +0 -0
  43. data/public/koda/fonts/ladyic__-webfont.woff +0 -0
  44. data/public/koda/images/ajax-loader.gif +0 -0
  45. data/public/koda/images/back.png +0 -0
  46. data/public/koda/images/bg-table-thead.png +0 -0
  47. data/public/koda/images/big_folder.png +0 -0
  48. data/public/koda/images/box_file.png +0 -0
  49. data/public/koda/images/car_add.png +0 -0
  50. data/public/koda/images/compress.png +0 -0
  51. data/public/koda/images/database_table.png +0 -0
  52. data/public/koda/images/feed_add.png +0 -0
  53. data/public/koda/images/feed_link.png +0 -0
  54. data/public/koda/images/file.png +0 -0
  55. data/public/koda/images/folder.png +0 -0
  56. data/public/koda/images/folder_image.png +0 -0
  57. data/public/koda/images/glyphicons-halflings-white.png +0 -0
  58. data/public/koda/images/glyphicons-halflings.png +0 -0
  59. data/public/koda/images/group_add.png +0 -0
  60. data/public/koda/images/group_key.png +0 -0
  61. data/public/koda/images/image_add.png +0 -0
  62. data/public/koda/images/layout_add.png +0 -0
  63. data/public/koda/images/package.png +0 -0
  64. data/public/koda/images/page_white_edit.png +0 -0
  65. data/public/koda/images/page_white_text.png +0 -0
  66. data/public/koda/images/photo_add.png +0 -0
  67. data/public/koda/images/toggle-collapse-dark.png +0 -0
  68. data/public/koda/images/toggle-collapse-light.png +0 -0
  69. data/public/koda/images/toggle-expand-dark.png +0 -0
  70. data/public/koda/images/toggle-expand-light.png +0 -0
  71. data/public/koda/images/twitter.png +0 -0
  72. data/public/koda/koda-editors/KodaEditor.js +843 -0
  73. data/public/koda/koda-editors/collection-editor.html +56 -0
  74. data/public/koda/koda-editors/generic-editor.css +112 -0
  75. data/public/koda/koda-editors/generic-editor.html +74 -0
  76. data/public/koda/koda-editors/koda-editor.css +72 -0
  77. data/public/koda/koda-editors/twitterfeed-editor.html +90 -0
  78. data/public/koda/koda-types/_builtin_registration.json +62 -0
  79. data/public/koda/koda-types/koda-access.json +49 -0
  80. data/public/koda/koda-types/koda-collection.json +12 -0
  81. data/public/koda/koda-types/koda-generictext.json +50 -0
  82. data/public/koda/koda-types/koda-media.json +58 -0
  83. data/public/koda/koda-types/koda-twitterfeed.json +79 -0
  84. data/public/koda/koda-types/koda-user.json +71 -0
  85. data/public/koda/nicEditorIcons.gif +0 -0
  86. data/public/koda/scripts/Koda.js +1200 -0
  87. data/public/koda/scripts/lib/DOMAssistant.js +4 -0
  88. data/public/koda/scripts/lib/modernizr.js +4 -0
  89. data/public/koda/scripts/lib/respond.js +2 -0
  90. data/public/koda/scripts/lib/selectivizr.js +5 -0
  91. data/public/koda/scripts/plugins/bootstrap.js +2027 -0
  92. data/public/koda/scripts/plugins/box.js +8 -0
  93. data/public/koda/scripts/plugins/fancybox/blank.gif +0 -0
  94. data/public/koda/scripts/plugins/fancybox/fancy_close.png +0 -0
  95. data/public/koda/scripts/plugins/fancybox/fancy_loading.png +0 -0
  96. data/public/koda/scripts/plugins/fancybox/fancy_nav_left.png +0 -0
  97. data/public/koda/scripts/plugins/fancybox/fancy_nav_right.png +0 -0
  98. data/public/koda/scripts/plugins/fancybox/fancy_shadow_e.png +0 -0
  99. data/public/koda/scripts/plugins/fancybox/fancy_shadow_n.png +0 -0
  100. data/public/koda/scripts/plugins/fancybox/fancy_shadow_ne.png +0 -0
  101. data/public/koda/scripts/plugins/fancybox/fancy_shadow_nw.png +0 -0
  102. data/public/koda/scripts/plugins/fancybox/fancy_shadow_s.png +0 -0
  103. data/public/koda/scripts/plugins/fancybox/fancy_shadow_se.png +0 -0
  104. data/public/koda/scripts/plugins/fancybox/fancy_shadow_sw.png +0 -0
  105. data/public/koda/scripts/plugins/fancybox/fancy_shadow_w.png +0 -0
  106. data/public/koda/scripts/plugins/fancybox/fancy_title_left.png +0 -0
  107. data/public/koda/scripts/plugins/fancybox/fancy_title_main.png +0 -0
  108. data/public/koda/scripts/plugins/fancybox/fancy_title_over.png +0 -0
  109. data/public/koda/scripts/plugins/fancybox/fancy_title_right.png +0 -0
  110. data/public/koda/scripts/plugins/fancybox/fancybox-x.png +0 -0
  111. data/public/koda/scripts/plugins/fancybox/fancybox-y.png +0 -0
  112. data/public/koda/scripts/plugins/fancybox/fancybox.png +0 -0
  113. data/public/koda/scripts/plugins/fancybox/jquery.easing-1.3.pack.js +72 -0
  114. data/public/koda/scripts/plugins/fancybox/jquery.fancybox-1.3.4.css +359 -0
  115. data/public/koda/scripts/plugins/fancybox/jquery.fancybox-1.3.4.js +1155 -0
  116. data/public/koda/scripts/plugins/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
  117. data/public/koda/scripts/plugins/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
  118. data/public/koda/scripts/plugins/fileuploader.js +1527 -0
  119. data/public/koda/scripts/plugins/jquery-class.js +7 -0
  120. data/public/koda/scripts/plugins/jquery.contextmenu/images/cut.png +0 -0
  121. data/public/koda/scripts/plugins/jquery.contextmenu/images/door.png +0 -0
  122. data/public/koda/scripts/plugins/jquery.contextmenu/images/page_white_copy.png +0 -0
  123. data/public/koda/scripts/plugins/jquery.contextmenu/images/page_white_delete.png +0 -0
  124. data/public/koda/scripts/plugins/jquery.contextmenu/images/page_white_edit.png +0 -0
  125. data/public/koda/scripts/plugins/jquery.contextmenu/images/page_white_paste.png +0 -0
  126. data/public/koda/scripts/plugins/jquery.contextmenu/jquery.contextMenu.css +63 -0
  127. data/public/koda/scripts/plugins/jquery.contextmenu/jquery.contextMenu.js +211 -0
  128. data/public/koda/scripts/plugins/jquery.js +2 -0
  129. data/public/koda/scripts/plugins/json2.js +277 -0
  130. data/public/koda/scripts/plugins/modernizr.js +2 -0
  131. data/public/koda/scripts/plugins/nicEdit.js +183 -0
  132. data/public/koda/scripts/plugins/qunit.js +1448 -0
  133. data/public/koda/scripts/plugins/spin.js +2 -0
  134. data/public/koda/scripts/plugins/uploader/README.md +77 -0
  135. data/public/koda/scripts/plugins/uploader/README.txt +89 -0
  136. data/public/koda/scripts/plugins/uploader/example/application.js +20 -0
  137. data/public/koda/scripts/plugins/uploader/example/index.html +109 -0
  138. data/public/koda/scripts/plugins/uploader/example/style.css +22 -0
  139. data/public/koda/scripts/plugins/uploader/example/upload.php +313 -0
  140. data/public/koda/scripts/plugins/uploader/jquery.fileupload-ui.css +100 -0
  141. data/public/koda/scripts/plugins/uploader/jquery.fileupload-ui.js +642 -0
  142. data/public/koda/scripts/plugins/uploader/jquery.fileupload.js +711 -0
  143. data/public/koda/scripts/plugins/uploader/jquery.iframe-transport.js +133 -0
  144. data/public/koda/scripts/plugins/uploader/pbar-ani.gif +0 -0
  145. data/public/koda/scripts/plugins/uploader/tests/index.html +115 -0
  146. data/public/koda/scripts/plugins/uploader/tests/tests.js +1008 -0
  147. data/public/koda/scripts/require.js +32 -0
  148. data/public/koda/scripts/specs.js +12 -0
  149. data/public/koda/scripts/specs/cd-command-spec.js +51 -0
  150. data/public/koda/scripts/specs/controller-spec.js +95 -0
  151. data/public/koda/scripts/specs/doubles/mock-command.js +21 -0
  152. data/public/koda/scripts/specs/doubles/mock-jamservice.js +33 -0
  153. data/public/koda/scripts/specs/doubles/mock-prompt.js +30 -0
  154. data/public/koda/scripts/specs/doubles/uiobject-double.js +15 -0
  155. data/public/koda/scripts/specs/edit-command-spec.js +76 -0
  156. data/public/koda/scripts/specs/ls-command-spec.js +61 -0
  157. data/public/koda/scripts/specs/mkdir-command-spec.js +40 -0
  158. data/public/koda/scripts/specs/peek-command-spec.js +24 -0
  159. data/public/koda/scripts/specs/remove-command-spec.js +37 -0
  160. data/public/koda/scripts/specs/service-spec.js +85 -0
  161. metadata +402 -0
@@ -0,0 +1,56 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" href="/koda/css/bootstrap.css" type="text/css" media="screen" title="no title" charset="utf-8">
4
+ <link rel="stylesheet" href="koda-editor.css" type="text/css" media="screen" title="no title" charset="utf-8">
5
+ <link rel="stylesheet" href="generic-editor.css" type="text/css" media="screen" title="no title" charset="utf-8">
6
+ <link rel="stylesheet" href="/koda/css/bootstrap-responsive.css" type="text/css" media="screen" title="no title" charset="utf-8">
7
+ <script src="/koda/scripts/plugins/json2.js" type="text/javascript" charset="utf-8"></script>
8
+ <script src="/koda/scripts/plugins/jquery.js" type="text/javascript" charset="utf-8"></script>
9
+ <script src="/koda/scripts/plugins/nicEdit.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="/koda/scripts/plugins/spin.js" type="text/javascript"></script>
11
+ <script src="KodaEditor.js?1133" type="text/javascript" charset="utf-8"></script>
12
+ <script src="/koda/scripts/plugins/fileuploader.js?234234a7aa6d4aa" type="text/javascript"></script>
13
+ </head>
14
+ <body>
15
+ <div id="editor"></div>
16
+ <script>
17
+
18
+ (function() {
19
+
20
+ var api = Editor.Api;
21
+ var isNew = api.isNew;
22
+
23
+ api.get('/koda/koda-types/koda-collection.json', function(kodaType) {
24
+ var onSubmit = function(data) {
25
+ var newItem = data.name.replace(/ /g,"-");
26
+ var url = PathHelper.getPath(newItem);
27
+ api.post(url, '{"alias":"_delete"}', function(sdata) {
28
+
29
+ if(sdata == "OK") {
30
+ api.delete(url + "/_delete", function(ddata) {
31
+ if(ddata == "OK"){
32
+ $('#status').text("Folder Saved!");
33
+ $('#status').show().fadeOut(2000);
34
+ }
35
+ });
36
+ } else {
37
+ $('#status').text(ddata.error);
38
+ $('#status').show().fadeOut(2000);
39
+ }
40
+
41
+ });
42
+ }
43
+
44
+ var kodaForm = Editor.Form($('#editor'), kodaType, onSubmit);
45
+ kodaForm.load({name:api.itemUrl});
46
+ if(!isNew) {
47
+ $('#status').text('Renaming a collection can cause unforeseen consequences. Save disabled.').show();
48
+ $('button[type="submit"]').attr("disabled", true);
49
+ }
50
+ });
51
+
52
+ })();
53
+
54
+ </script>
55
+ </body>
56
+ <html>
@@ -0,0 +1,112 @@
1
+ /* Have ideas for improving this CSS for the general community? Submit your changes at: https://github.com/Valums-File-Uploader/file-uploader */
2
+ .qq-uploader {
3
+ position: relative;
4
+ width: 100%;
5
+ left: -12px;
6
+ }
7
+ .qq-upload-button {
8
+ display: block;
9
+ /*or inline-block*/
10
+ width: 105px;
11
+ padding: 7px 0;
12
+ text-align: center;
13
+ background: #880000;
14
+ border-bottom: 1px solid #DDD;
15
+ color: #FFF;
16
+ }
17
+ .qq-upload-button-hover {
18
+ background: #CC0000;
19
+ }
20
+ .qq-upload-button-focus {
21
+ outline: 1px dotted #000000;
22
+ }
23
+ .qq-upload-drop-area, .qq-upload-extra-drop-area {
24
+ position: absolute;
25
+ top: 0;
26
+ left: 0;
27
+ width: 100%;
28
+ height: 100%;
29
+ min-height: 30px;
30
+ z-index: 2;
31
+ background: #FF9797;
32
+ text-align: center;
33
+ }
34
+ .qq-upload-drop-area span {
35
+ display: block;
36
+ position: absolute;
37
+ top: 50%;
38
+ width: 100%;
39
+ margin-top: -8px;
40
+ font-size: 16px;
41
+ }
42
+ .qq-upload-extra-drop-area {
43
+ position: relative;
44
+ margin-top: 50px;
45
+ font-size: 16px;
46
+ padding-top: 30px;
47
+ height: 20px;
48
+ min-height: 40px;
49
+ }
50
+ .qq-upload-drop-area-active {
51
+ background: #FF7171;
52
+ }
53
+ .qq-upload-list {
54
+ margin: 0;
55
+ padding: 0;
56
+ list-style: none;
57
+ }
58
+ .qq-upload-list li {
59
+ margin: 0;
60
+ padding: 9px;
61
+ line-height: 15px;
62
+ font-size: 16px;
63
+ background-color: #FFF0BD;
64
+ }
65
+ .qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text, .qq-upload-finished {
66
+ margin-right: 12px;
67
+ }
68
+ .qq-upload-file {
69
+ }
70
+ .qq-upload-spinner {
71
+ display: inline-block;
72
+ background: url("loading.gif");
73
+ width: 15px;
74
+ height: 15px;
75
+ vertical-align: text-bottom;
76
+ }
77
+ .qq-upload-finished {
78
+ display:none;
79
+ width:15px;
80
+ height:15px;
81
+ vertical-align:text-bottom;
82
+ }
83
+ .qq-upload-size, .qq-upload-cancel {
84
+ font-size: 12px;
85
+ font-weight: normal;
86
+ }
87
+ .qq-upload-failed-text {
88
+ display: none;
89
+ }
90
+ .qq-upload-failed-icon {
91
+ display:none;
92
+ width:15px;
93
+ height:15px;
94
+ vertical-align:text-bottom;
95
+ }
96
+ .qq-upload-fail .qq-upload-failed-text {
97
+ display: inline;
98
+ }
99
+ .qq-upload-list li.qq-upload-success {
100
+ background-color: #5DA30C;
101
+ color: #FFFFFF;
102
+ }
103
+ .qq-upload-list li.qq-upload-fail {
104
+ background-color: #D60000;
105
+ color: #FFFFFF;
106
+ }
107
+
108
+ ul.fileuploader {
109
+ float: left;
110
+ position: relative;
111
+ left: 11px;
112
+ }
@@ -0,0 +1,74 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" href="/koda/css/bootstrap.css" type="text/css" media="screen" title="no title" charset="utf-8">
4
+ <link rel="stylesheet" href="koda-editor.css?2eaa3d" type="text/css" media="screen" title="no title" charset="utf-8">
5
+ <link rel="stylesheet" href="generic-editor.css?4adwa4" type="text/css" media="screen" title="no title" charset="utf-8">
6
+ <link rel="stylesheet" href="/koda/css/bootstrap-responsive.css" type="text/css" media="screen" title="no title" charset="utf-8">
7
+ <script src="/koda/scripts/plugins/json2.js" type="text/javascript" charset="utf-8"></script>
8
+ <script src="/koda/scripts/plugins/jquery.js" type="text/javascript" charset="utf-8"></script>
9
+ <script src="/koda/scripts/plugins/nicEdit.js?2333da323d3234aa" type="text/javascript" charset="utf-8"></script>
10
+ <script src="/koda/scripts/plugins/spin.js" type="text/javascript"></script>
11
+ <script src="KodaEditor.js?98aaaa2sdfaa84a447" type="text/javascript" charset="utf-8"></script>
12
+ <script src="/koda/scripts/plugins/fileuploader.js?2342234a7aa6ad4aa" type="text/javascript"></script>
13
+ </head>
14
+ <body>
15
+ <div id="editor"></div>
16
+ <script src="/koda/scripts/plugins/bootstrap.js" type="text/javascript" charset="utf-8"></script>
17
+ <script>
18
+
19
+ (function() {
20
+
21
+ var api = Editor.Api;
22
+ var isNew = api.isNew;
23
+ var url = PathHelper.getPath(api.itemUrl);
24
+
25
+ api.get(api.typeUrl, function(kodaType) {
26
+
27
+ var onUpdate = function(sdata){
28
+
29
+ $('#spinner').data().spinner.stop();
30
+ $('.btn-primary').removeAttr('disabled');
31
+
32
+ if(sdata == "OK") {
33
+ $('#status').text("Document Saved!");
34
+ $('#status').show().fadeOut(2000);
35
+ } else {
36
+ $('#status').text(sdata.error);
37
+ $('#status').addClass('alert alert-error')
38
+ $('#status').show().fadeOut(2000);
39
+ }
40
+
41
+ }
42
+
43
+ var onSubmit = function(data) {
44
+
45
+ $('#spinner').spin(Editor.spinnerOpts);
46
+ $('.btn-primary').attr('disabled', 'disabled');
47
+
48
+ if(isNew) {
49
+
50
+ var dataString = JSON.stringify(data, null, 2);
51
+ api.post(url, dataString, onUpdate);
52
+
53
+ } else {
54
+
55
+ var dataString = JSON.stringify(data, null, 2);
56
+ api.put(url, dataString, onUpdate);
57
+
58
+ }
59
+ }
60
+
61
+ var kodaForm = Editor.Form($('#editor'), kodaType, onSubmit);
62
+ api.get(url, function(content){
63
+ if(content != []) {
64
+ kodaForm.load(content);
65
+ }
66
+ });
67
+
68
+ });
69
+
70
+ })();
71
+
72
+ </script>
73
+ </body>
74
+ <html>
@@ -0,0 +1,72 @@
1
+ .nicEdit-panelContain {
2
+ width: 100% !important;
3
+ }
4
+
5
+ .nicEdit-main {
6
+ min-height: 200px !important;
7
+ }
8
+
9
+ #error-form {
10
+ padding: 40px;
11
+ background: paleGoldenrod;
12
+ }
13
+
14
+ input, textarea, select {
15
+ width: 74% !important;
16
+ }
17
+
18
+ .spinner-form {
19
+ position: relative !important;
20
+ left: 93% !important;
21
+ top: -12px !important;
22
+ }
23
+
24
+ .form-horizontal .control-label {
25
+ width: 150px !important;
26
+ padding-top: 1px !important;
27
+ padding-right: 10px !important;
28
+ }
29
+
30
+ .help-inline {
31
+ clear: both;
32
+ float: right;
33
+ width: 80%;
34
+ font-size: smaller;
35
+ color: gray;
36
+ }
37
+
38
+ .richTextEditor {
39
+ position: relative;
40
+ left: 20%;
41
+ top: -20px;
42
+ }
43
+
44
+ .nicEdit-main img {
45
+ padding: 5px;
46
+ vertical-align: top;
47
+ float: left;
48
+ overflow: auto;
49
+ }
50
+
51
+ .uploadedImage {
52
+ float: right;
53
+ clear: both;
54
+ position: relative;
55
+ top: -74px;
56
+ right: 200px;
57
+ width: 140px;
58
+ height: 90px;
59
+ }
60
+
61
+ .no-wrap {
62
+ margin: 0px !important;
63
+ padding: 0px !important;
64
+ }
65
+
66
+ #status {
67
+ float: right;
68
+ position: relative;
69
+ top: -23px;
70
+ right: 21px;
71
+ padding: 5px;
72
+ }
@@ -0,0 +1,90 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" href="/koda/css/bootstrap.css" type="text/css" media="screen" title="no title" charset="utf-8">
4
+ <link rel="stylesheet" href="koda-editor.css" type="text/css" media="screen" title="no title" charset="utf-8">
5
+ <link rel="stylesheet" href="generic-editor.css" type="text/css" media="screen" title="no title" charset="utf-8">
6
+ <link rel="stylesheet" href="/koda/css/bootstrap-responsive.css" type="text/css" media="screen" title="no title" charset="utf-8">
7
+ <script src="/koda/scripts/plugins/json2.js" type="text/javascript" charset="utf-8"></script>
8
+ <script src="/koda/scripts/plugins/jquery.js" type="text/javascript" charset="utf-8"></script>
9
+ <script src="/koda/scripts/plugins/nicEdit.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="/koda/scripts/plugins/spin.js" type="text/javascript"></script>
11
+ <script src="KodaEditor.js?1133" type="text/javascript" charset="utf-8"></script>
12
+ <script src="/koda/scripts/plugins/fileuploader.js?234234a7aa6d4aa" type="text/javascript"></script>
13
+ </head>
14
+ <body>
15
+ <div id="editor"></div>
16
+ <script src="/koda/scripts/plugins/bootstrap.js" type="text/javascript" charset="utf-8"></script>
17
+ <script>
18
+
19
+ (function() {
20
+
21
+ var api = Editor.Api;
22
+ var isNew = api.isNew;
23
+ var url = PathHelper.getPath(api.itemUrl);
24
+
25
+ api.get(api.typeUrl, function(kodaType) {
26
+
27
+ var onUpdate = function(sdata){
28
+
29
+ if(sdata == "OK") {
30
+ $('#status').text("Document Saved!");
31
+ $('#status').show().fadeOut(2000);
32
+ } else {
33
+ $('#status').text(sdata.error);
34
+ $('#status').show().fadeOut(2000);
35
+ }
36
+
37
+ }
38
+
39
+ var onSubmit = function(data) {
40
+
41
+ var ref = 'twitterfeed';
42
+
43
+ if(data.showuserfeed){
44
+ var doc_link = "http://search.twitter.com/search.json";
45
+ doc_link += '?q=from:'+data.name+'&rpp='+data.user_count;
46
+ data._koda_doc_links = doc_link;
47
+ ref = data.name.replace(/ /g,"-").toLowerCase()
48
+ }
49
+ if(data.showqueriedfeed){
50
+ var doc_link = "http://search.twitter.com/search.json";
51
+ doc_link += '?q='+data.query+'&rpp='+data.query_count;
52
+ if(data._koda_doc_links != ''){
53
+ data._koda_doc_links += ','+doc_link;
54
+ }
55
+ else
56
+ {
57
+ data._koda_doc_links += doc_link;
58
+ ref = data.query.replace(/ /g,"-").toLowerCase()
59
+ }
60
+ }
61
+
62
+ if(isNew) {
63
+
64
+ data.alias = ref+'_twitterfeed';
65
+
66
+ var dataString = JSON.stringify(data, null, 2);
67
+ api.post(url, dataString, onUpdate);
68
+
69
+ } else {
70
+
71
+ var dataString = JSON.stringify(data, null, 2);
72
+ api.put(url, dataString, onUpdate);
73
+
74
+ }
75
+ }
76
+
77
+ var kodaForm = Editor.Form($('#editor'), kodaType, onSubmit);
78
+ api.get(url, function(content){
79
+ if(content != []) {
80
+ kodaForm.load(content);
81
+ }
82
+ });
83
+
84
+ });
85
+
86
+ })();
87
+
88
+ </script>
89
+ </body>
90
+ <html>
@@ -0,0 +1,62 @@
1
+ [
2
+ { "group" : "koda",
3
+ "title" : "Koda Types",
4
+ "types" : [
5
+ {
6
+ "title" : "Folder",
7
+ "description" :"A container to hold KodaTypes",
8
+ "icon" : "/koda/images/package.png",
9
+ "editor" : "/koda/koda-editors/collection-editor.html",
10
+ "type" : "/koda/koda-types/koda-collection.json",
11
+ "allowedin" : "root"
12
+ },
13
+ {
14
+ "title" : "Text File",
15
+ "description" :"This will create a simple text document",
16
+ "icon" : "/koda/images/database_table.png",
17
+ "editor" : "/koda/koda-editors/generic-editor.html",
18
+ "type" : "/koda/koda-types/koda-generictext.json",
19
+ "allowedin" : "collection"
20
+ },
21
+ {
22
+ "title" : "Media File",
23
+ "description" :"Image, Video or Audio",
24
+ "icon" : "/koda/images/image_add.png",
25
+ "editor" : "/koda/koda-editors/generic-editor.html",
26
+ "type" : "/koda/koda-types/koda-media.json",
27
+ "allowedin" : "collection"
28
+ },
29
+ {
30
+ "title" : "Twitter Feed",
31
+ "description" :"This will include posts of a twitter feed",
32
+ "icon" : "/koda/images/twitter.png",
33
+ "editor" : "/koda/koda-editors/twitterfeed-editor.html",
34
+ "type" : "/koda/koda-types/koda-twitterfeed.json",
35
+ "allowedin" : "collection"
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "group" : "admin",
41
+ "title" : "Administration",
42
+ "admin_users" : true,
43
+ "types" : [
44
+ {
45
+ "title" : "Koda User",
46
+ "description" :"This will create a koda user",
47
+ "icon" : "/koda/images/group_add.png",
48
+ "editor" : "/koda/koda-editors/generic-editor.html",
49
+ "type" : "/koda/koda-types/koda-user.json",
50
+ "allowedin" : "collection"
51
+ },
52
+ {
53
+ "title" : "Koda Access",
54
+ "description" :"Control access to a folder",
55
+ "icon" : "/koda/images/group_key.png",
56
+ "editor" : "/koda/koda-editors/generic-editor.html",
57
+ "type" : "/koda/koda-types/koda-access.json",
58
+ "allowedin" : "collection"
59
+ }
60
+ ]
61
+ }
62
+ ]