Permalink
Browse files

Merge remote-tracking branch 'origin/3.0'

Conflicts:
	admin/css/screen.css
  • Loading branch information...
2 parents 169366a + ff39f9a commit 3214a0a75645445c067fe2f7396c1999b78b3680 @chillu chillu committed Nov 6, 2012
@@ -145,11 +145,11 @@ public function getEditForm($id = null, $fields = null) {
$actionParam = $this->request->param('Action');
if($actionParam == 'groups') {
- $groupsTab->addExtraClass('ui-state-selected');
+ $groupsTab->addExtraClass('ui-state-active');
} elseif($actionParam == 'users') {
- $usersTab->addExtraClass('ui-state-selected');
+ $usersTab->addExtraClass('ui-state-active');
} elseif($actionParam == 'roles') {
- $rolesTab->addExtraClass('ui-state-selected');
+ $rolesTab->addExtraClass('ui-state-active');
}
$actions = new FieldList();
View
Oops, something went wrong.
@@ -924,23 +924,21 @@ jQuery.noConflict();
redrawTabs: function() {
this.rewriteHashlinks();
- var id = this.attr('id'), cookieId = 'ui-tabs-' + id,
- selectedTab = this.find('ul:first .ui-tabs-selected');
+ var id = this.attr('id'), selectedTab = this.find('ul:first .ui-tabs-active');
- // Fix for wrong cookie storage of deselected tabs
- if($.cookie && id && $.cookie(cookieId) == -1) $.cookie(cookieId, 0);
if(!this.data('tabs')) this.tabs({
- cookie: ($.cookie && id) ? { expires: 30, path: '/', name: cookieId } : false,
- ajaxOptions: {
+ selected: (selectedTab.index() != -1) ? selectedTab.index() : 0,
+ beforeLoad: function(e, settings) {
// Overwrite ajax loading to use CMS logic instead
- beforeSend: function(xhr, settings) {
- if(!isSameUrl(document.location.href, settings.url)) {
- $('.cms-container').loadPanel(settings.url);
- }
- return false;
- }
+ var makeAbs = $.path.makeUrlAbsolute,
+ baseUrl = $('base').attr('href'),
+ isSame = (makeAbs(settings.url, baseUrl) == makeAbs(document.location.href));
+
+ if(!isSame) $('.cms-container').loadPanel(settings.url);
+ $(this).tabs('select', settings.tab.index());
+
+ return false;
},
- selected: (selectedTab.index() != -1) ? selectedTab.index() : 0,
show: function(e, ui) {
// Usability: Hide actions for "readonly" tabs (which don't contain any editable fields)
var actions = $(this).closest('form').find('.Actions');
@@ -954,15 +952,14 @@ jQuery.noConflict();
},
/**
- * Replace prefixes for all hashlinks in tabs.
- * SSViewer rewrites them from "#Root_MyTab" to
- * e.g. "/admin/#Root_MyTab" which makes them
- * unusable for jQuery UI.
+ * Ensure hash links are prefixed with the current page URL,
+ * otherwise jQuery interprets them as being external.
*/
rewriteHashlinks: function() {
$(this).find('ul a').each(function() {
- var href = $(this).attr('href');
- if(href) $(this).attr('href', href.replace(/.*(#.*)/, '$1'));
+ var matches = $(this).attr('href').match(/#.*/);
+ if(!matches) return;
+ $(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);
});
}
});
@@ -1,35 +1,5 @@
(function($) {
- $.entwine('ss', function($) {
- /**
- * Creates a jQuery UI tab navigation bar, detached from the container DOM structure.
- */
- $('.ss-ui-tabs-nav').entwine({
- onadd: function() {
- this.redraw();
- },
- redraw: function() {
- this.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-panel ui-corner-bottom');
- this.find('ul').addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
- this.find('li').addClass('ui-state-default ui-corner-top');
- // TODO Figure out selected tab
- var selected = this.find('li.current');
- if(!selected.length) selected = this.find('li:first');
- selected.selectIt();
- }
- });
-
- $('.ss-ui-tabs-nav li').entwine({
- onclick: function() {
- this.selectIt();
- },
- selectIt: function() {
- var cls = 'ui-tabs-selected ui-state-active';
- this.addClass(cls).siblings().not(this).removeClass(cls);
- }
- });
- });
-
/**
* Allows icon definition via HTML5 data attrs for easier handling in PHP
*/
View
@@ -26,6 +26,7 @@
li {
top: 0;
+ border-bottom: 0 !important;
a {
padding: 0 15px;
@@ -1,4 +1,4 @@
-<div class="cms-content center $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
+<div class="cms-content cms-tabset center $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
<div class="cms-content-header north">
<div class="cms-content-header-info">
@@ -12,10 +12,10 @@
</h2>
</div>
- <div class="cms-content-header-tabs ss-ui-tabs-nav">
+ <div class="cms-content-header-tabs">
<ul>
<% loop ManagedModelTabs %>
- <li class="tab-$ClassName $LinkOrCurrent">
+ <li class="tab-$ClassName $LinkOrCurrent<% if $LinkOrCurrent == 'current' %> ui-tabs-active<% end_if %>">
<a href="$Link" class="cms-panel-link">$Title</a>
</li>
<% end_loop %>
View
Oops, something went wrong.
@@ -111,11 +111,36 @@ This is how you do it:
Composer will scan all of the repositories you list, collect meta-data about the packages within them, and use them in favour of the packages listed on packagist. To switch back to using the mainline version of the package, just remove your the `repositories` section from `composer.json` and run `php composer.phar update`.
-**Note:** It is important to keep using the same pattern of branch names as the main repositories does. If your version is a fork of 3.0, then call the branch `3.0`, not `3.0-myproj` or `myproj`. Otherwise, the depenency resolution gets confused.
-
For more information, read the ["Repositories" chapter of the Composer documentation](http://getcomposer.org/doc/05-repositories.md).
-## Preparing your project for working on SilverStripe
+### Forks and branch names
+
+Generally, you should keep using the same pattern of branch names as the main repositories does. If your version is a fork of 3.0, then call the branch `3.0`, not `3.0-myproj` or `myproj`. Otherwise, the depenency resolution gets confused.
+
+Sometimes, however, this isn't feasible. For example, you might have a number of project forks stored in a single repository, such as your personal github fork of a project. Or you might be testing/developing a feature branch. Or it might just be confusing to other team members to call the branch of your modified version `3.0`.
+
+In this case, you need to use Composer's aliasing feature to specify how you want the project branch to be treated, when it comes to dependency resolution.
+
+Open `composer.json`, and find the module's `require`. Then put `as (core version name)` on the end.
+
+ {
+ ...
+ "require": {
+ "php": ">=5.3.2",
+ "silverstripe/cms": "3.0.3",
+ "silverstripe/framework": "dev-myproj as 3.0.x-dev",
+ "silverstripe-themes/simple": "*"
+ },
+ ...
+ }
+
+What is means is that when the `myproj` branch is checked out into a project, this will satisfy any dependencies that 3.0.x-dev would meet. So, if another module has `"silverstripe/framework": ">=3.0.0"` in its dependency list, it won't get a conflict.
+
+Both the version and the alias are specified as Composer versions, not branch names. For the relationship between branch/tag names and Composer vesrions, read [the relevant Composer documentation](http://getcomposer.org/doc/02-libraries.md#specifying-the-version).
+
+This is not the only way to set things up in Composer. For more information on this topic, read the ["Aliases" chapter of the Composer documentation](http://getcomposer.org/doc/articles/aliases.md).
+
+## Setting up an environment for working on SilverStripe
So you want to contribute to SilverStripe? Fantastic! There are a couple modules that are helpful
@@ -39,7 +39,7 @@ getting out of date.
* End-user: [userhelp.silverstripe.org](http://userhelp.silverstripe.org) - a custom SilverStripe project (not open sourced at the moment).
* Developer Guides: [doc.silverstripe.org](http://doc.silverstripe.org) - powered by a
-SilverStripe project that uses the ["sapphiredocs" module](https://github.com/silverstripe/silverstripe-sapphiredocs)
+SilverStripe project that uses the ["docsviewer" module](https://github.com/silverstripe/silverstripe-docsviewer)
to convert Markdown formatted files into searchable HTML pages with index lists.
Its contents are fetched from different releases automatically every couple of minutes.
* Developer API Docuumentation: [api.silverstripe.org](http://api.silverstripe.org) - powered by a customized
@@ -111,7 +111,7 @@ that you can link from the `README.md` file. Example:
tutorial.md
howto-search-mymodule.md
-The ["sapphiredocs" module](http://open.silverstripe.org/browser/modules/sapphiredocs/trunk) can be used
+The ["docsviewer" module](http://open.silverstripe.org/browser/modules/docsviewer/trunk) can be used
to list and render content inside a `docs/` folder (although it is not required, Markdown is designed
to be readable in plain text as well).
@@ -17,9 +17,9 @@ and HTML output should still be readable with our custom markup unparsed.
While most of the Markdown syntax is parseable by all common implementations,
the special syntax is relying on a custom SilverStripe project that powers `http://doc.silverstripe.org`.
-The website a standard SilverStripe installation with the [sapphiredocs](https://github.com/silverstripe/silverstripe-sapphiredocs/)
-module installed (see module [README](https://github.com/silverstripe/silverstripe-sapphiredocs/blob/master/README.md) and
-[documentation](https://github.com/silverstripe/silverstripe-sapphiredocs/tree/master/docs/en)).
+The website a standard SilverStripe installation with the [docsviewer](https://github.com/silverstripe/silverstripe-docsviewer/)
+module installed (see module [README](https://github.com/silverstripe/silverstripe-docsviewer/blob/master/README.md) and
+[documentation](https://github.com/silverstripe/silverstripe-docsviewer/tree/master/docs/en)).
## Syntax
@@ -96,19 +96,19 @@ You can link to absolute image URLs as well, of course.
### How do I preview my own SS Markdown?
-Thats only possible with the `sapphiredocs` module - we don't have a standalone parser.
+Thats only possible with the `docsviewer` module - we don't have a standalone parser.
### Can I run my own documentation server?
-Yes, the `sapphiredocs` module just requires a default SilverStripe installation (2.4+).
+Yes, the `docsviewer` module just requires a default SilverStripe installation (2.4+).
### Can I generate SS Markdown other formats?
Currently this is not supported, as all HTML is generated on the fly.
### Can I contribute to the parser and rendering project?
-Of course, the `sapphiredocs` code is BSD licensed - we're looking forward to your contributions!
+Of course, the `docsviewer` code is BSD licensed - we're looking forward to your contributions!
## Related ##
View
@@ -10,7 +10,7 @@
this._super();
},
onremove: function() {
- this.tabs('destroy');
+ if(this.data('tabs')) this.tabs('destroy');
this._super();
},
redrawTabs: function() {
@@ -19,15 +19,14 @@
},
/**
- * Replace prefixes for all hashlinks in tabs.
- * SSViewer rewrites them from "#Root_MyTab" to
- * e.g. "/admin/#Root_MyTab" which makes them
- * unusable for jQuery UI.
+ * Ensure hash links are prefixed with the current page URL,
+ * otherwise jQuery interprets them as being external.
*/
rewriteHashlinks: function() {
$(this).find('ul a').each(function() {
- var href = $(this).attr('href');
- if(href) $(this).attr('href', href.replace(/.*(#.*)/, '$1'));
+ var matches = $(this).attr('href').match(/#.*/);
+ if(!matches) return;
+ $(this).attr('href', document.location.href.replace(/#.*/, '') + matches[0]);
});
}
});
Oops, something went wrong.

0 comments on commit 3214a0a

Please sign in to comment.