[ckan-changes] commit/ckan: zephod: [js][s]: Glitchfixed add dataset form. Mismatched classes due to refactor.
Bitbucket
commits-noreply at bitbucket.org
Tue Nov 1 19:06:44 UTC 2011
1 new commit in ckan:
https://bitbucket.org/okfn/ckan/changeset/13fe6ae084a8/
changeset: 13fe6ae084a8
branch: release-v1.5
user: zephod
date: 2011-11-01 20:06:34
summary: [js][s]: Glitchfixed add dataset form. Mismatched classes due to refactor.
affected #: 3 files
diff -r 39daf1afd64a8bfa5b410e1db1105230b25e17c2 -r 13fe6ae084a83029c3589abf597c87c41911091a ckan/public/css/style.css
--- a/ckan/public/css/style.css
+++ b/ckan/public/css/style.css
@@ -707,7 +707,7 @@
/* =================== */
/* = URL Slug Editor = */
/* =================== */
-input.url-slug-editor {
+input.url-input {
width: 250px;
}
diff -r 39daf1afd64a8bfa5b410e1db1105230b25e17c2 -r 13fe6ae084a83029c3589abf597c87c41911091a ckan/public/scripts/application.js
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -18,6 +18,11 @@
client: client
};
+ var isFrontPage = $('body.index.home').length > 0;
+ if (isFrontPage) {
+ CKAN.Utils.setupWelcomeBanner($('.js-welcome-banner'));
+ }
+
var isDatasetView = $('body.package.read').length > 0;
if (isDatasetView) {
var _dataset = new CKAN.Model.Dataset(preload_dataset);
@@ -83,8 +88,16 @@
var messageDiv = $('<div />').html(msg).addClass(category).hide();
$('.flash-messages').append(messageDiv);
messageDiv.show(1200);
+ };
- };
+ // Animate the appearance of an element by expanding its height
+ my.animateHeight = function(element, animTime) {
+ if (!animTime) animTime = 350;
+ element.show();
+ var finalHeight = element.height();
+ element.height(0);
+ element.animate({height:finalHeight}, animTime);
+ }
my.bindInputChanges = function(input, callback) {
input.keyup(callback);
@@ -93,14 +106,36 @@
input.change(callback);
};
+ my.setupWelcomeBanner = function(banner) {
+
+ var cookieName = 'ckan_killtopbar';
+ var isKilled = ($.cookie(cookieName)!=null);
+ if (!isKilled) {
+ banner.show();
+ // Bind to the close button
+ banner.find('.js-kill-button').live('click', function() {
+ $.cookie(cookieName, 'true', { expires: 365 });
+ banner.hide();
+ });
+ }
+ };
+
my.setupUrlEditor = function(slugType,readOnly) {
// Page elements to hook onto
var titleInput = $('.js-title');
var urlText = $('.js-url-text');
var urlSuffix = $('.js-url-suffix');
- var urlInput = $('.js-url-slug-editor');
+ var urlInput = $('.js-url-input');
var validMsg = $('.js-url-is-valid');
+ console.log(titleInput);
+ console.log(urlText);
+ console.log(urlSuffix);
+ console.log(urlInput);
+ console.log(validMsg);
+
+
+
var api_url = '/api/2/util/is_slug_valid';
// (make length less than max, in case we need a few for '_' chars to de-clash slugs.)
var MAX_SLUG_LENGTH = 90;
diff -r 39daf1afd64a8bfa5b410e1db1105230b25e17c2 -r 13fe6ae084a83029c3589abf597c87c41911091a ckan/templates/package/new_package_form.html
--- a/ckan/templates/package/new_package_form.html
+++ b/ckan/templates/package/new_package_form.html
@@ -41,7 +41,7 @@
<dt class="name-label"><label class="field_req" for="name">Url</label></dt><dd class="name-field">
- <span class="url-text">${g.site_url+h.url_for(controller='package', id=None)+'/'}<span class="js-url-viewmode js-url-suffix"> </span><a href="#" style="display: none;" class="url-edit js-url-editlink js-url-viewmode">(edit)</a></span>
+ <span class="js-url-text url-text">${g.site_url+h.url_for(controller='package', id=None)+'/'}<span class="js-url-viewmode js-url-suffix"> </span><a href="#" style="display: none;" class="url-edit js-url-editlink js-url-viewmode">(edit)</a></span><input style="display: none;" id="name" maxlength="100" name="name" type="text" class="url-input js-url-editmode js-url-input" value="${data.get('name', '')}" /><p class="js-url-is-valid"> </p></dd>
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list