Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move scripts and CSS out of HTML, only show metadata diffs for most r…
…ecent displayed change
- Loading branch information
1 parent
4a990c6
commit 0fb1373
Showing
9 changed files
with
89 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* Watches the "Show metadata diff" button on the Changes summary page. | ||
* When the button is pressed, toggles the display of the metadata diff | ||
* for the chronologically most recent revision on and off. | ||
* | ||
* target - a button to watch for changes (default: button) | ||
* | ||
*/ | ||
|
||
ckan.module('metadata-button', function(jQuery) { | ||
return { | ||
options: { | ||
target: 'button' | ||
}, | ||
|
||
initialize: function () { | ||
// Watch for our button to be clicked. | ||
this.el.on('click', jQuery.proxy(this._onClick, this)); | ||
}, | ||
|
||
_onClick: function(event) { | ||
console.log("PRESSED THE BUTTON"); | ||
var div = document.getElementById("metadata_diff"); | ||
if (div.style.display === "none") { | ||
div.style.display = "block"; | ||
} | ||
else { | ||
div.style.display = "none"; | ||
} | ||
var btn = document.getElementById("metadata_button"); | ||
if (btn.value === "Show metadata diff") { | ||
btn.value = "Hide metadata diff"; | ||
} | ||
else { | ||
btn.value = "Show metadata diff"; | ||
} | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters