Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cribjs-editor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
cribjs-editor
Commits
379fa45b
Commit
379fa45b
authored
Oct 01, 2020
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CribSWGadget: Add dedicated method to change crib enable gadget
parent
3e455dfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
cribjs_launcher.js
cribjs_launcher.js
+8
-0
gadget/crib-sw-gadget.js
gadget/crib-sw-gadget.js
+23
-0
No files found.
cribjs_launcher.js
View file @
379fa45b
...
@@ -383,6 +383,14 @@
...
@@ -383,6 +383,14 @@
.
allowPublicAcquisition
(
"
crib_sw_getScope
"
,
function
(
param_list
)
{
.
allowPublicAcquisition
(
"
crib_sw_getScope
"
,
function
(
param_list
)
{
return
callCribSWGadget
(
this
,
"
getScope
"
,
param_list
);
return
callCribSWGadget
(
this
,
"
getScope
"
,
param_list
);
})
})
.
allowPublicAcquisition
(
"
crib_sw_setCribEnableGadgetUrl
"
,
function
(
param_list
)
{
return
callCribSWGadget
(
this
,
"
setCribEnableGadgetUrl
"
,
param_list
);
})
.
allowPublicAcquisition
(
"
crib_sw_getCribEnableGadgetUrl
"
,
function
(
param_list
)
{
return
callCribSWGadget
(
this
,
"
getCribEnableGadgetUrl
"
,
param_list
);
})
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
gadget/crib-sw-gadget.js
View file @
379fa45b
...
@@ -65,6 +65,7 @@
...
@@ -65,6 +65,7 @@
return
getStorageGadget
(
gadget
);
return
getStorageGadget
(
gadget
);
})
})
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
setSetting
"
,
"
setSetting
"
)
.
declareMethod
(
'
allDocs
'
,
function
(
params
)
{
.
declareMethod
(
'
allDocs
'
,
function
(
params
)
{
return
getStorageGadget
(
this
)
return
getStorageGadget
(
this
)
.
push
(
function
(
storage_gadget
)
{
.
push
(
function
(
storage_gadget
)
{
...
@@ -117,6 +118,28 @@
...
@@ -117,6 +118,28 @@
.
push
(
function
(
storage_gadget
)
{
.
push
(
function
(
storage_gadget
)
{
return
storage_gadget
.
getScope
();
return
storage_gadget
.
getScope
();
});
});
})
.
declareMethod
(
'
setCribEnableGadgetUrl
'
,
function
(
url
)
{
var
gadget
=
this
;
// XXX Should perform checks
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
setSetting
(
"
site_editor_gadget_url
"
,
url
);
})
.
push
(
function
()
{
// XXX CLN Needs to call that one here in order to make sure we do not
// run accidently in a possible bug in RenderJS when the same gadget
// is declared twice in parallel. CLN needs to reproduce and
// investigate this issue.
return
getStorageGadget
(
gadget
);
});
})
.
declareMethod
(
'
getCribEnableGadgetUrl
'
,
function
(
url
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getSetting
(
"
site_editor_gadget_url
"
);
});
});
});
}(
window
,
rJS
,
RSVP
,
jIO
));
}(
window
,
rJS
,
RSVP
,
jIO
));
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment