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
e340e859
Commit
e340e859
authored
Oct 01, 2020
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SelectSitePage: Add dedicated method to change crib enable gadget
parent
379fa45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
gadget/gadget_cribjs_page_select_site.js
gadget/gadget_cribjs_page_select_site.js
+17
-16
No files found.
gadget/gadget_cribjs_page_select_site.js
View file @
e340e859
...
...
@@ -4,30 +4,28 @@
"
use strict
"
;
function
setSiteGadgetUrl
(
gadget
,
event
)
{
var
site_editor_gadget_url
,
gadget_validator
;
site_editor_gadget_url
=
gadget
.
props
.
element
.
querySelector
(
'
form.site-editor-gadget-url .url
'
).
value
;
/*
*/
var
editor_gadget_url
,
gadget_validator
;
editor_gadget_url
=
gadget
.
props
.
element
.
querySelector
(
'
form.site-editor-gadget-url .url
'
).
value
;
return
gadget
.
getDeclaredGadget
(
"
interface_validator
"
)
.
push
(
function
(
result
)
{
gadget_validator
=
result
;
gadget
.
props
.
element
.
querySelector
(
'
div.interface_validator
'
)
.
style
=
""
;
return
gadget_validator
.
render
({
gadget_to_check_url
:
site_
editor_gadget_url
,
gadget_to_check_url
:
editor_gadget_url
,
required_interface_list
:
[
"
crib-enable-interface.html
"
]
});
})
.
push
(
function
(
result
)
{
if
(
result
)
{
return
gadget
.
setSetting
(
"
site_editor_gadget_url
"
,
site_
editor_gadget_url
)
return
gadget
.
crib_sw_setCribEnableGadgetUrl
(
editor_gadget_url
)
.
push
(
function
()
{
gadget
.
props
.
element
.
querySelector
(
"
.crib-site-save-status
"
)
.
textContent
=
"
Saved
"
+
site_
editor_gadget_url
+
"
files at
"
+
Date
();
.
textContent
=
"
Saved
"
+
editor_gadget_url
+
"
files at
"
+
Date
();
});
}
gadget
.
props
.
element
.
querySelector
(
"
.crib-site-save-status
"
)
.
textContent
=
"
Error founds for
"
+
site_
editor_gadget_url
+
"
at
"
+
Date
()
+
"
Please see message bellow
"
;
.
textContent
=
"
Error founds for
"
+
editor_gadget_url
+
"
at
"
+
Date
()
+
"
Please see message bellow
"
;
});
}
...
...
@@ -40,8 +38,14 @@
g
.
props
.
start_deferred
=
RSVP
.
defer
();
});
})
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
setSetting
"
,
"
setSetting
"
)
.
declareAcquiredMethod
(
"
crib_sw_setCribEnableGadgetUrl
"
,
"
crib_sw_setCribEnableGadgetUrl
"
)
.
declareAcquiredMethod
(
"
crib_sw_getCribEnableGadgetUrl
"
,
"
crib_sw_getCribEnableGadgetUrl
"
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
;
if
(
options
===
undefined
)
...
...
@@ -50,13 +54,10 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
getURL
=
window
.
location
;
return
gadget
.
getSetting
(
"
site_editor_gadget_url
"
,
getURL
.
protocol
+
"
//
"
+
getURL
.
host
+
"
/crib-enable.html
"
);
return
gadget
.
crib_sw_getCribEnableGadgetUrl
();
})
.
push
(
function
(
site_
editor_gadget_url
)
{
gadget
.
props
.
element
.
querySelector
(
'
form.site-editor-gadget-url .url
'
).
value
=
site_
editor_gadget_url
;
.
push
(
function
(
editor_gadget_url
)
{
gadget
.
props
.
element
.
querySelector
(
'
form.site-editor-gadget-url .url
'
).
value
=
editor_gadget_url
;
return
gadget
.
props
.
start_deferred
.
resolve
();
});
})
...
...
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