card-mod-script 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/javascript/decko/autosave.js.coffee +30 -0
- data/lib/javascript/decko/bridge.js.coffee +31 -0
- data/lib/javascript/decko/card_menu.js.coffee +26 -0
- data/lib/javascript/decko/components.js.coffee +51 -0
- data/lib/javascript/decko/decko.js.coffee +100 -0
- data/lib/javascript/decko/doubleclick.js.coffee +30 -0
- data/lib/javascript/decko/editor.js.coffee +55 -0
- data/lib/javascript/decko/filter.js.coffee +176 -0
- data/lib/javascript/decko/filter_items.js.coffee +128 -0
- data/lib/javascript/decko/filter_links.js.coffee +81 -0
- data/lib/javascript/decko/follow.js.coffee +22 -0
- data/lib/javascript/decko/layout.js.coffee +76 -0
- data/lib/javascript/decko/link_editor.js.coffee +61 -0
- data/lib/javascript/decko/mod.js.coffee +85 -0
- data/lib/javascript/decko/modal.js.coffee +110 -0
- data/lib/javascript/decko/name_editor.js.coffee +51 -0
- data/lib/javascript/decko/navbox.js.coffee +74 -0
- data/lib/javascript/decko/nest_editor.js.coffee +166 -0
- data/lib/javascript/decko/nest_editor_name.js.coffee +102 -0
- data/lib/javascript/decko/nest_editor_options.js.coffee +93 -0
- data/lib/javascript/decko/nest_editor_rules.js.coffee +3 -0
- data/lib/javascript/decko/overlay.js.coffee +57 -0
- data/lib/javascript/decko/recaptcha.js.coffee +19 -0
- data/lib/javascript/decko/selectable_filtered_content.js.coffee +12 -0
- data/lib/javascript/decko/slot.js.coffee +172 -0
- data/lib/javascript/decko/slot_ready.js.coffee +11 -0
- data/lib/javascript/decko/slotter.js.coffee +269 -0
- data/lib/javascript/decko/upload.js.coffee +57 -0
- data/lib/javascript/jquery-ui.js +10 -0
- data/lib/javascript/jquery.autosize.js +274 -0
- data/lib/javascript/jquery.iframe-transport.js +185 -0
- data/lib/javascript/script_html5shiv_printshiv.js +1 -0
- data/lib/javascript/script_pointer_config.js.coffee +80 -0
- data/lib/javascript/script_pointer_list_editor.js.coffee +67 -0
- data/lib/javascript/theme-textmate.js +130 -0
- data/set/abstract/script.rb +85 -0
- data/set/right/script.rb +19 -0
- data/set/self/01_script_libraries.rb +1 -0
- data/set/self/script.rb +1 -0
- data/set/self/script_decko.rb +12 -0
- data/set/self/script_editors.rb +1 -0
- data/set/self/script_html5shiv_printshiv.rb +11 -0
- data/set/self/script_jquery.rb +10 -0
- data/set/self/script_jquery_helper.rb +14 -0
- data/set/self/script_mods.rb +1 -0
- data/set/self/script_pointer_config.rb +9 -0
- data/set/type/coffee_script.rb +25 -0
- data/set/type/java_script.rb +9 -0
- data/vendor/jquery_file_upload/CONTRIBUTING.md +15 -0
- data/vendor/jquery_file_upload/LICENSE.txt +21 -0
- data/vendor/jquery_file_upload/README.md +107 -0
- data/vendor/jquery_file_upload/angularjs.html +211 -0
- data/vendor/jquery_file_upload/basic-plus.html +226 -0
- data/vendor/jquery_file_upload/basic.html +136 -0
- data/vendor/jquery_file_upload/bower-version-update.js +16 -0
- data/vendor/jquery_file_upload/bower.json +64 -0
- data/vendor/jquery_file_upload/cors/postmessage.html +75 -0
- data/vendor/jquery_file_upload/cors/result.html +24 -0
- data/vendor/jquery_file_upload/css/jquery-ui-demo-ie8.css +21 -0
- data/vendor/jquery_file_upload/css/jquery-ui-demo.css +67 -0
- data/vendor/jquery_file_upload/css/jquery.fileupload-noscript.css +22 -0
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui-noscript.css +17 -0
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +57 -0
- data/vendor/jquery_file_upload/css/jquery.fileupload.css +37 -0
- data/vendor/jquery_file_upload/css/style.css +15 -0
- data/vendor/jquery_file_upload/img/loading.gif +0 -0
- data/vendor/jquery_file_upload/img/progressbar.gif +0 -0
- data/vendor/jquery_file_upload/index.html +255 -0
- data/vendor/jquery_file_upload/jquery-ui.html +252 -0
- data/vendor/jquery_file_upload/js/app.js +101 -0
- data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +126 -0
- data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +89 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-angular.js +437 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +113 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +326 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +161 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +178 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +714 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +125 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +113 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload.js +1486 -0
- data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +224 -0
- data/vendor/jquery_file_upload/js/main.js +75 -0
- data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +748 -0
- data/vendor/jquery_file_upload/package.json +55 -0
- data/vendor/jquery_file_upload/server/gae-go/app.yaml +12 -0
- data/vendor/jquery_file_upload/server/gae-go/app/main.go +361 -0
- data/vendor/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-go/static/robots.txt +2 -0
- data/vendor/jquery_file_upload/server/gae-python/app.yaml +17 -0
- data/vendor/jquery_file_upload/server/gae-python/main.py +204 -0
- data/vendor/jquery_file_upload/server/gae-python/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-python/static/robots.txt +2 -0
- data/vendor/jquery_file_upload/server/php/Dockerfile +38 -0
- data/vendor/jquery_file_upload/server/php/UploadHandler.php +1411 -0
- data/vendor/jquery_file_upload/server/php/docker-compose.yml +9 -0
- data/vendor/jquery_file_upload/server/php/index.php +15 -0
- data/vendor/jquery_file_upload/test/index.html +172 -0
- data/vendor/jquery_file_upload/test/test.js +1292 -0
- data/vendor/jquery_rails/CHANGELOG.md +359 -0
- data/vendor/jquery_rails/CONTRIBUTING.md +132 -0
- data/vendor/jquery_rails/Gemfile +22 -0
- data/vendor/jquery_rails/MIT-LICENSE +21 -0
- data/vendor/jquery_rails/README.md +75 -0
- data/vendor/jquery_rails/Rakefile +59 -0
- data/vendor/jquery_rails/VERSIONS.md +62 -0
- data/vendor/jquery_rails/jquery-rails.gemspec +26 -0
- data/vendor/jquery_rails/lib/jquery-rails.rb +1 -0
- data/vendor/jquery_rails/lib/jquery/assert_select.rb +149 -0
- data/vendor/jquery_rails/lib/jquery/rails.rb +8 -0
- data/vendor/jquery_rails/lib/jquery/rails/engine.rb +6 -0
- data/vendor/jquery_rails/lib/jquery/rails/version.rb +9 -0
- data/vendor/jquery_rails/test/assert_select_jquery_test.rb +85 -0
- data/vendor/jquery_rails/test/test_helper.rb +6 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.js +11008 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.js +5 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery.min.map +1 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.js +9814 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.js +4 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery2.min.map +1 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.js +10364 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.js +2 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery3.min.map +1 -0
- data/vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js +555 -0
- metadata +212 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=T.elements;return"string"==typeof e?e.split(" "):e}function a(e){var t=N[e[b]];return t||(t={},S++,e[b]=S,N[S]=t),t}function o(e,n,r){if(n||(n=t),p)return n.createElement(e);r||(r=a(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),o.canHaveChildren&&!y.test(e)?r.frag.appendChild(o):o}function i(e,n){if(e||(e=t),p)return e.createDocumentFragment();n=n||a(e);for(var o=n.frag.cloneNode(),i=0,c=r(),l=c.length;l>i;i++)o.createElement(c[i]);return o}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return T.shivMethods?o(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/\w+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(T,t.frag)}function l(e){e||(e=t);var r=a(e);return!T.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),p||c(e,r),e}function u(e){for(var t,n=e.getElementsByTagName("*"),a=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),i=[];a--;)t=n[a],o.test(t.nodeName)&&i.push(t.applyElement(s(t)));return i}function s(e){for(var t,n=e.attributes,r=n.length,a=e.ownerDocument.createElement(x+":"+e.nodeName);r--;)t=n[r],t.specified&&a.setAttribute(t.nodeName,t.nodeValue);return a.style.cssText=e.style.cssText,a}function m(e){for(var t,n=e.split("{"),a=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),i="$1"+x+"\\:$2";a--;)t=n[a]=n[a].split("}"),t[t.length-1]=t[t.length-1].replace(o,i),n[a]=t.join("}");return n.join("{")}function d(e){for(var t=e.length;t--;)e[t].removeNode()}function f(e){function t(){clearTimeout(i._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,o,i=a(e),c=e.namespaces,l=e.parentWindow;return!C||e.printShived?e:("undefined"==typeof c[x]&&c.add(x),l.attachEvent("onbeforeprint",function(){t();for(var a,i,c,l=e.styleSheets,s=[],d=l.length,f=Array(d);d--;)f[d]=l[d];for(;c=f.pop();)if(!c.disabled&&F.test(c.media)){try{a=c.imports,i=a.length}catch(h){i=0}for(d=0;i>d;d++)f.push(a[d]);try{s.push(c.cssText)}catch(h){}}s=m(s.reverse().join("")),o=u(e),r=n(e,s)}),l.attachEvent("onafterprint",function(){d(o),clearTimeout(i._removeSheetTimer),i._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,p,v="3.6.2",g=e.html5||{},y=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,b="_html5shiv",S=0,N={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",h="hidden"in e,p=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,p=!0}}();var T={elements:g.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:v,shivCSS:g.shivCSS!==!1,supportsUnknownElements:p,shivMethods:g.shivMethods!==!1,type:"default",shivDocument:l,createElement:o,createDocumentFragment:i};e.html5=T,l(t);var F=/^$|\b(?:all|print)\b/,x="html5shiv",C=!p&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();T.type+=" print",T.shivPrint=f,f(t)}(this,document);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
$.extend decko.editorContentFunctionMap,
|
|
2
|
+
'select.pointer-select': ->
|
|
3
|
+
pointerContent @val()
|
|
4
|
+
'select.pointer-multiselect': ->
|
|
5
|
+
pointerContent @val()
|
|
6
|
+
'.pointer-radio-list': ->
|
|
7
|
+
pointerContent @find('input:checked').val()
|
|
8
|
+
'.pointer-list-ul': ->
|
|
9
|
+
pointerContent @find('input').map( -> $(this).val() )
|
|
10
|
+
'.pointer-link-list-ul': ->
|
|
11
|
+
decko.linkListContent @find('.input-group')
|
|
12
|
+
'._nest-list-ul': ->
|
|
13
|
+
decko.nestListContent @find('.input-group')
|
|
14
|
+
'.pointer-checkbox-list': ->
|
|
15
|
+
pointerContent @find('input:checked').map( -> $(this).val() )
|
|
16
|
+
'.pointer-select-list': ->
|
|
17
|
+
pointerContent @find('.pointer-select select').map( -> $(this).val() )
|
|
18
|
+
'._pointer-filtered-list': ->
|
|
19
|
+
pointerContent @find('._filtered-list-item').map( -> $(this).data('cardName') )
|
|
20
|
+
'._pointer-list': ->
|
|
21
|
+
pointerContent @find('._pointer-item').map( -> $(this).val() )
|
|
22
|
+
# can't find evidence that the following is in use: #efm
|
|
23
|
+
# '.pointer-mixed': ->
|
|
24
|
+
# element = '.pointer-checkbox-sublist input:checked,\
|
|
25
|
+
# .pointer-sublist-ul input'
|
|
26
|
+
# pointerContent @find(element).map( -> $(this).val() )
|
|
27
|
+
# must happen after pointer-list-ul, I think
|
|
28
|
+
'.perm-editor': -> permissionsContent this
|
|
29
|
+
|
|
30
|
+
decko.editorInitFunctionMap['.pointer-list-editor'] = ->
|
|
31
|
+
@sortable({handle: '.handle', cancel: ''})
|
|
32
|
+
decko.initPointerList @find('input')
|
|
33
|
+
|
|
34
|
+
decko.editorInitFunctionMap['._pointer-filtered-list'] = ->
|
|
35
|
+
@sortable({handle: '._handle', cancel: ''})
|
|
36
|
+
|
|
37
|
+
$.extend decko,
|
|
38
|
+
initPointerList: (input) ->
|
|
39
|
+
decko.initAutoCardPlete input
|
|
40
|
+
|
|
41
|
+
initAutoCardPlete: (input) ->
|
|
42
|
+
optionsCard = input.data 'options-card'
|
|
43
|
+
return unless !!optionsCard
|
|
44
|
+
path = optionsCard + '.json?view=name_match'
|
|
45
|
+
input.autocomplete { source: decko.slotPath(path) }
|
|
46
|
+
|
|
47
|
+
pointerContent: (vals) ->
|
|
48
|
+
list = $.map $.makeArray(vals), (v) -> if v then '[[' + v + ']]'
|
|
49
|
+
$.makeArray(list).join "\n"
|
|
50
|
+
|
|
51
|
+
linkListContent: (input_groups) ->
|
|
52
|
+
vals = input_groups.map( ->
|
|
53
|
+
v = $(this).find('input._reference').val()
|
|
54
|
+
title = $(this).find('input._title').val()
|
|
55
|
+
v += "|#{title}" if title.length > 0
|
|
56
|
+
v
|
|
57
|
+
)
|
|
58
|
+
list = $.map $.makeArray(vals), (v) -> if v then '[[' + v + ']]'
|
|
59
|
+
$.makeArray(list).join "\n"
|
|
60
|
+
|
|
61
|
+
nestListContent: (input_groups) ->
|
|
62
|
+
vals = input_groups.map( ->
|
|
63
|
+
v = $(this).find('input._reference').val()
|
|
64
|
+
options = $(this).find('input._nest-options').val()
|
|
65
|
+
v += "|#{options}" if options.length > 0
|
|
66
|
+
v
|
|
67
|
+
)
|
|
68
|
+
list = $.map $.makeArray(vals), (v) -> if v then '{{' + v + '}}'
|
|
69
|
+
$.makeArray(list).join "\n"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
pointerContent = (vals) ->
|
|
73
|
+
decko.pointerContent vals
|
|
74
|
+
# deprecated. backwards compatibility
|
|
75
|
+
|
|
76
|
+
permissionsContent = (ed) ->
|
|
77
|
+
return '_left' if ed.find('#inherit').is(':checked')
|
|
78
|
+
groups = ed.find('.perm-group input:checked').map( -> $(this).val() )
|
|
79
|
+
indivs = ed.find('.perm-indiv input' ).map( -> $(this).val() )
|
|
80
|
+
pointerContent $.makeArray(groups).concat($.makeArray(indivs))
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
$(window).ready ->
|
|
2
|
+
# add pointer item when clicking on "add another" button
|
|
3
|
+
$('body').on 'click', '._pointer-item-add', (event)->
|
|
4
|
+
decko.addPointerItem this
|
|
5
|
+
event.preventDefault() # Prevent link from following its href
|
|
6
|
+
|
|
7
|
+
# add pointer item when you hit enter in an item
|
|
8
|
+
$('body').on 'keydown', '.pointer-item-text', (event)->
|
|
9
|
+
if event.key == 'Enter'
|
|
10
|
+
decko.addPointerItem this
|
|
11
|
+
event.preventDefault() # was triggering extra item in unrelated pointer
|
|
12
|
+
|
|
13
|
+
# enable/disable add
|
|
14
|
+
$('body').on 'keyup', '.pointer-item-text', (_event)->
|
|
15
|
+
decko.updateAddItemButton this
|
|
16
|
+
|
|
17
|
+
$('body').on 'click', '.pointer-item-delete', ->
|
|
18
|
+
item = $(this).closest 'li'
|
|
19
|
+
list = item.closest('ul')
|
|
20
|
+
if list.find('.pointer-li').length > 1
|
|
21
|
+
item.remove()
|
|
22
|
+
else
|
|
23
|
+
item.find('input').val ''
|
|
24
|
+
decko.updateAddItemButton(list)
|
|
25
|
+
|
|
26
|
+
decko.slotReady (slot) ->
|
|
27
|
+
slot.find('.pointer-list-editor').each ->
|
|
28
|
+
decko.updateAddItemButton this
|
|
29
|
+
|
|
30
|
+
$.extend decko,
|
|
31
|
+
addPointerItem: (el) ->
|
|
32
|
+
slot = $(el).slot()
|
|
33
|
+
slot.trigger "slotDestroy"
|
|
34
|
+
# why is this necessary?
|
|
35
|
+
# this can have a lot of side effects in a multi-card form.
|
|
36
|
+
|
|
37
|
+
newInput = decko.nextPointerInput decko.lastPointerItem(el)
|
|
38
|
+
newInput.val ''
|
|
39
|
+
|
|
40
|
+
slot.trigger "slotReady"
|
|
41
|
+
decko.initializeEditors slot
|
|
42
|
+
# should be (but is not) handled by slotReady
|
|
43
|
+
# without this, "add another" was breaking tinymce editors in same slot
|
|
44
|
+
|
|
45
|
+
newInput.first().focus()
|
|
46
|
+
decko.updateAddItemButton el
|
|
47
|
+
decko.initPointerList newInput
|
|
48
|
+
|
|
49
|
+
nextPointerInput: (lastItem)->
|
|
50
|
+
lastInputs = lastItem.find 'input'
|
|
51
|
+
all_empty = true
|
|
52
|
+
for input in lastInputs
|
|
53
|
+
all_empty = all_empty and $(input).val() == ''
|
|
54
|
+
return lastInputs if all_empty
|
|
55
|
+
|
|
56
|
+
newItem = lastItem.clone()
|
|
57
|
+
lastItem.after newItem
|
|
58
|
+
newItem.attr("data-index", parseInt(lastItem.attr("data-index") + 1))
|
|
59
|
+
newItem.find 'input'
|
|
60
|
+
|
|
61
|
+
lastPointerItem: (el)->
|
|
62
|
+
$(el).closest('.content-editor').find '.pointer-li:last'
|
|
63
|
+
|
|
64
|
+
updateAddItemButton: (el)->
|
|
65
|
+
button = $(el).closest('.content-editor').find '._pointer-item-add'
|
|
66
|
+
disabled = decko.lastPointerItem(el).find('input').val() == ''
|
|
67
|
+
button.prop 'disabled', disabled
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
exports.isDark = false;
|
|
5
|
+
exports.cssClass = "ace-tm";
|
|
6
|
+
exports.cssText = ".ace-tm .ace_gutter {\
|
|
7
|
+
background: #f0f0f0;\
|
|
8
|
+
color: #333;\
|
|
9
|
+
}\
|
|
10
|
+
.ace-tm .ace_print-margin {\
|
|
11
|
+
width: 1px;\
|
|
12
|
+
background: #e8e8e8;\
|
|
13
|
+
}\
|
|
14
|
+
.ace-tm .ace_fold {\
|
|
15
|
+
background-color: #6B72E6;\
|
|
16
|
+
}\
|
|
17
|
+
.ace-tm {\
|
|
18
|
+
background-color: #FFFFFF;\
|
|
19
|
+
color: black;\
|
|
20
|
+
}\
|
|
21
|
+
.ace-tm .ace_cursor {\
|
|
22
|
+
color: black;\
|
|
23
|
+
}\
|
|
24
|
+
.ace-tm .ace_invisible {\
|
|
25
|
+
color: rgb(191, 191, 191);\
|
|
26
|
+
}\
|
|
27
|
+
.ace-tm .ace_storage,\
|
|
28
|
+
.ace-tm .ace_keyword {\
|
|
29
|
+
color: blue;\
|
|
30
|
+
}\
|
|
31
|
+
.ace-tm .ace_constant {\
|
|
32
|
+
color: rgb(197, 6, 11);\
|
|
33
|
+
}\
|
|
34
|
+
.ace-tm .ace_constant.ace_buildin {\
|
|
35
|
+
color: rgb(88, 72, 246);\
|
|
36
|
+
}\
|
|
37
|
+
.ace-tm .ace_constant.ace_language {\
|
|
38
|
+
color: rgb(88, 92, 246);\
|
|
39
|
+
}\
|
|
40
|
+
.ace-tm .ace_constant.ace_library {\
|
|
41
|
+
color: rgb(6, 150, 14);\
|
|
42
|
+
}\
|
|
43
|
+
.ace-tm .ace_invalid {\
|
|
44
|
+
background-color: rgba(255, 0, 0, 0.1);\
|
|
45
|
+
color: red;\
|
|
46
|
+
}\
|
|
47
|
+
.ace-tm .ace_support.ace_function {\
|
|
48
|
+
color: rgb(60, 76, 114);\
|
|
49
|
+
}\
|
|
50
|
+
.ace-tm .ace_support.ace_constant {\
|
|
51
|
+
color: rgb(6, 150, 14);\
|
|
52
|
+
}\
|
|
53
|
+
.ace-tm .ace_support.ace_type,\
|
|
54
|
+
.ace-tm .ace_support.ace_class {\
|
|
55
|
+
color: rgb(109, 121, 222);\
|
|
56
|
+
}\
|
|
57
|
+
.ace-tm .ace_keyword.ace_operator {\
|
|
58
|
+
color: rgb(104, 118, 135);\
|
|
59
|
+
}\
|
|
60
|
+
.ace-tm .ace_string {\
|
|
61
|
+
color: rgb(3, 106, 7);\
|
|
62
|
+
}\
|
|
63
|
+
.ace-tm .ace_comment {\
|
|
64
|
+
color: rgb(76, 136, 107);\
|
|
65
|
+
}\
|
|
66
|
+
.ace-tm .ace_comment.ace_doc {\
|
|
67
|
+
color: rgb(0, 102, 255);\
|
|
68
|
+
}\
|
|
69
|
+
.ace-tm .ace_comment.ace_doc.ace_tag {\
|
|
70
|
+
color: rgb(128, 159, 191);\
|
|
71
|
+
}\
|
|
72
|
+
.ace-tm .ace_constant.ace_numeric {\
|
|
73
|
+
color: rgb(0, 0, 205);\
|
|
74
|
+
}\
|
|
75
|
+
.ace-tm .ace_variable {\
|
|
76
|
+
color: rgb(49, 132, 149);\
|
|
77
|
+
}\
|
|
78
|
+
.ace-tm .ace_xml-pe {\
|
|
79
|
+
color: rgb(104, 104, 91);\
|
|
80
|
+
}\
|
|
81
|
+
.ace-tm .ace_entity.ace_name.ace_function {\
|
|
82
|
+
color: #0000A2;\
|
|
83
|
+
}\
|
|
84
|
+
.ace-tm .ace_heading {\
|
|
85
|
+
color: rgb(12, 7, 255);\
|
|
86
|
+
}\
|
|
87
|
+
.ace-tm .ace_list {\
|
|
88
|
+
color:rgb(185, 6, 144);\
|
|
89
|
+
}\
|
|
90
|
+
.ace-tm .ace_meta.ace_tag {\
|
|
91
|
+
color:rgb(0, 22, 142);\
|
|
92
|
+
}\
|
|
93
|
+
.ace-tm .ace_string.ace_regex {\
|
|
94
|
+
color: rgb(255, 0, 0)\
|
|
95
|
+
}\
|
|
96
|
+
.ace-tm .ace_marker-layer .ace_selection {\
|
|
97
|
+
background: rgb(181, 213, 255);\
|
|
98
|
+
}\
|
|
99
|
+
.ace-tm.ace_multiselect .ace_selection.ace_start {\
|
|
100
|
+
box-shadow: 0 0 3px 0px white;\
|
|
101
|
+
border-radius: 2px;\
|
|
102
|
+
}\
|
|
103
|
+
.ace-tm .ace_marker-layer .ace_step {\
|
|
104
|
+
background: rgb(252, 255, 0);\
|
|
105
|
+
}\
|
|
106
|
+
.ace-tm .ace_marker-layer .ace_stack {\
|
|
107
|
+
background: rgb(164, 229, 101);\
|
|
108
|
+
}\
|
|
109
|
+
.ace-tm .ace_marker-layer .ace_bracket {\
|
|
110
|
+
margin: -1px 0 0 -1px;\
|
|
111
|
+
border: 1px solid rgb(192, 192, 192);\
|
|
112
|
+
}\
|
|
113
|
+
.ace-tm .ace_marker-layer .ace_active-line {\
|
|
114
|
+
background: rgba(0, 0, 0, 0.07);\
|
|
115
|
+
}\
|
|
116
|
+
.ace-tm .ace_gutter-active-line {\
|
|
117
|
+
background-color : #dcdcdc;\
|
|
118
|
+
}\
|
|
119
|
+
.ace-tm .ace_marker-layer .ace_selected-word {\
|
|
120
|
+
background: rgb(250, 250, 255);\
|
|
121
|
+
border: 1px solid rgb(200, 200, 250);\
|
|
122
|
+
}\
|
|
123
|
+
.ace-tm .ace_indent-guide {\
|
|
124
|
+
background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
|
|
125
|
+
}\
|
|
126
|
+
";
|
|
127
|
+
|
|
128
|
+
var dom = require("../lib/dom");
|
|
129
|
+
dom.importCssString(exports.cssText, exports.cssClass);
|
|
130
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
|
|
3
|
+
require "uglifier"
|
|
4
|
+
|
|
5
|
+
def self.included host_class
|
|
6
|
+
host_class.include_set Abstract::Machine
|
|
7
|
+
host_class.include_set Abstract::MachineInput
|
|
8
|
+
|
|
9
|
+
host_class.machine_input { standard_machine_input }
|
|
10
|
+
host_class.store_machine_output filetype: "js"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def standard_machine_input
|
|
14
|
+
js = format(:js)._render_core
|
|
15
|
+
js = compress_js js if compress_js?
|
|
16
|
+
comment_with_source js
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def comment_with_source js
|
|
20
|
+
"//#{name}\n#{js}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def compress_js input
|
|
24
|
+
Uglifier.compile input
|
|
25
|
+
rescue => e
|
|
26
|
+
# CoffeeScript is compiled in a view
|
|
27
|
+
# If there is a CoffeeScript syntax error we get the rescued view here
|
|
28
|
+
# and the error that the rescued view is no valid Javascript
|
|
29
|
+
# To get the original error we have to refer to Card::Error.current
|
|
30
|
+
raise Card::Error, compression_error_message(e)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def compression_error_message e
|
|
34
|
+
if Card::Error.current
|
|
35
|
+
Card::Error.current.message
|
|
36
|
+
else
|
|
37
|
+
"JavaScript::SyntaxError (#{name}): #{e.message}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def compress_js?
|
|
42
|
+
Cardio.config.compress_javascript
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def clean_html?
|
|
46
|
+
false
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
format do
|
|
50
|
+
def chunk_list
|
|
51
|
+
# turn off autodetection of uri's
|
|
52
|
+
:nest_only
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# def default_nest_view
|
|
56
|
+
# :raw
|
|
57
|
+
# end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
format :html do
|
|
61
|
+
def input_type
|
|
62
|
+
:ace_editor
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def ace_mode
|
|
66
|
+
:javascript
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def content_changes action, diff_type, hide_diff=false
|
|
70
|
+
wrap_with(:pre) { super }
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
view :core do
|
|
74
|
+
script = card.format(:js).render_core
|
|
75
|
+
process_content highlight(script)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def highlight script
|
|
79
|
+
::CodeRay.scan(script, :js).div
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def diff_args
|
|
84
|
+
{ diff_format: :text }
|
|
85
|
+
end
|
data/set/right/script.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
include_set Abstract::Machine
|
|
2
|
+
|
|
3
|
+
store_machine_output filetype: "js"
|
|
4
|
+
|
|
5
|
+
def ok_to_read
|
|
6
|
+
true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
view :javascript_include_tag do
|
|
10
|
+
%(
|
|
11
|
+
<script src="#{card.machine_output_url}" type="text/javascript"></script>
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
format :html do
|
|
16
|
+
def raw_help_text
|
|
17
|
+
"JavaScript (or CoffeeScript) for card's page."
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include_set Abstract::CodePointer
|
data/set/self/script.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
setting_opts group: :webpage, position: 5
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include_set Abstract::CodeFile
|
|
2
|
+
|
|
3
|
+
def source_files
|
|
4
|
+
%w[mod editor name_editor autosave doubleclick layout navbox upload
|
|
5
|
+
slot modal overlay recaptcha slotter bridge
|
|
6
|
+
nest_editor nest_editor_rules nest_editor_options nest_editor_name
|
|
7
|
+
link_editor
|
|
8
|
+
components decko follow card_menu slot_ready
|
|
9
|
+
filter filter_links filter_items selectable_filtered_content].map do |n|
|
|
10
|
+
"decko/#{n}.js.coffee"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include_set Abstract::CodePointer
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
include_set Abstract::CodeFile
|
|
2
|
+
Self::ScriptLibraries.add_item :script_jquery_helper
|
|
3
|
+
|
|
4
|
+
def source_files
|
|
5
|
+
# jquery-ui includes all interaction components, the dialog and the autocomplete widget
|
|
6
|
+
# and all dependencies for those
|
|
7
|
+
# decko depends on autocomplete, sortable, jquery.autosize and jquery.fileupload
|
|
8
|
+
# the dialog widget is not used in decko but in wikirate
|
|
9
|
+
# don't know if iframe-transport is needed but it used to be there
|
|
10
|
+
%w[jquery-ui.js
|
|
11
|
+
jquery.autosize.js
|
|
12
|
+
../../vendor/jquery_file_upload/js/jquery.fileupload.js
|
|
13
|
+
../../vendor/jquery_file_upload/js/jquery.iframe-transport.js]
|
|
14
|
+
end
|