Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Toggl Button for Firefox
drupal
Commits
b4b4293c
Commit
b4b4293c
authored
9 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
initial commit
parents
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drupal.user.js
+102
-0
102 additions, 0 deletions
drupal.user.js
with
102 additions
and
0 deletions
drupal.user.js
0 → 100644
+
102
−
0
View file @
b4b4293c
// ==UserScript==
// @name Toggl-Button Drupal
// @namespace https://github.com/jurgenhaas/toggl-button-greasemonkey
// @version 1.3
// @include https://www.drupal.org/node/*
// @include https://www.drupal.org/project/issues/*
// @include https://www.drupal.org/project/user
// @include https://drupal.org/node/*
// @include https://drupal.org/project/issues/*
// @include https://drupal.org/project/user
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_info
// @grant GM_registerMenuCommand
// @require https://greasyfork.org/scripts/2670-toggllibrary/code/TogglLibrary.js
// @resource togglStyle https://raw.githubusercontent.com/jurgenhaas/toggl-button-greasemonkey/v1.3/TogglLibrary.css
// @description Toggle button for Drupal issue queues
// ==/UserScript==
new
TogglButtonGM
(
'
body.node-type-project-issue
'
,
function
(
elem
)
{
var
description
,
projectIds
=
[],
href
=
document
.
getElementById
(
'
tabs
'
).
getElementsByTagName
(
'
a
'
)[
0
].
getAttribute
(
'
href
'
),
id
=
href
.
match
(
/
(?:
node|comment
\/
reply
)\/(\d
+
)
/
)[
1
],
titleElem
=
elem
.
querySelector
(
'
#page-subtitle
'
,
elem
),
projectElem
=
document
.
querySelector
(
'
.field-name-field-project .field-items .field-item
'
);
description
=
titleElem
.
textContent
.
trim
();
if
(
id
!==
null
)
{
description
=
id
+
"
"
+
description
;
}
if
(
projectElem
!==
null
)
{
projectIds
.
push
(
projectElem
.
textContent
.
trim
());
}
return
{
className
:
'
drupal
'
,
description
:
description
,
projectIds
:
projectIds
};
});
new
TogglButtonGM
(
'
body.page-project-issues table.views-table tbody tr
'
,
function
(
elem
)
{
var
description
,
projectIds
=
[],
href
=
elem
.
querySelector
(
'
td.views-field-title a
'
).
getAttribute
(
'
href
'
),
id
=
href
.
match
(
/
(?:
node|comment
\/
reply
)\/(\d
+
)
/
)[
1
],
titleElem
=
elem
.
querySelector
(
'
td.views-field-title a
'
),
projectElem
=
document
.
querySelector
(
'
.breadcrumb a
'
);
description
=
titleElem
.
textContent
.
trim
();
if
(
id
!==
null
)
{
description
=
id
+
"
"
+
description
;
}
if
(
projectElem
!==
null
)
{
projectIds
.
push
(
projectElem
.
textContent
.
trim
());
}
return
{
className
:
'
drupal
'
,
description
:
description
,
projectIds
:
projectIds
,
buttonType
:
'
minimal
'
,
targetSelectors
:
{
context
:
elem
,
link
:
'
.views-field-field-issue-assigned
'
,
projectSelect
:
'
.views-field-created
'
}
};
});
new
TogglButtonGM
(
'
body.page-project-user .view-content table.views-table.project-issue tbody tr
'
,
function
(
elem
)
{
var
description
,
projectIds
=
[],
href
=
elem
.
querySelector
(
'
td.views-field-title a
'
).
getAttribute
(
'
href
'
),
id
=
href
.
match
(
/
(?:
node|comment
\/
reply
)\/(\d
+
)
/
)[
1
],
titleElem
=
elem
.
querySelector
(
'
td.views-field-title a
'
),
projectElem
=
elem
.
querySelector
(
'
td.views-field-title-1 a
'
);
description
=
titleElem
.
textContent
.
trim
();
if
(
id
!==
null
)
{
description
=
id
+
"
"
+
description
;
}
if
(
projectElem
!==
null
)
{
projectIds
.
push
(
projectElem
.
textContent
.
trim
());
}
return
{
className
:
'
drupal
'
,
description
:
description
,
projectIds
:
projectIds
,
buttonType
:
'
minimal
'
,
targetSelectors
:
{
context
:
elem
,
link
:
'
.views-field-name
'
,
projectSelect
:
'
.views-field-created
'
}
};
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment