From 02afd8a32edb13ea7fc2266ac80092ea15c0930c Mon Sep 17 00:00:00 2001 From: Alvin Li Date: Wed, 9 Oct 2013 15:52:53 +0800 Subject: * treat 'apps/utils' as regular django app; which used to store general tools for used in other apps * moved 'templatetags' from 'apps/indicator' to 'apps/utils' * '.gitignore' to ignore 'fixtures_bak' * moved js plugins from 'apps/indicator/static/plugins' to 'staticfiles/plugins' apps/recommend: * updated 'recommend.models'; o commented 'recommend.models.ResearchCombination' (not used) * implemented views 'add_edit_blog_info' and 'ajax_add_edit_configs'; * added pages 'templates/recommend/add_edit_blog_info.html', 'add_edit_blog_info_error.html'; o related css and javascripts files * added 'tools.py'; * added 'utils/tools.py' for placing generic functions; * deleted 'initial_data.json' (mv 'fixtures' to 'fixtures_bak'); * small fixes to 'indicator.models', 'sciblog.models' and 'sfaccount.views' * fixed automatically show 'proper_nouns' annotation in blog: recovered the line 'import signals' in 'sciblog.models' * added 'is_ok()' method for 'recommend.models.ResearchConfig'; --- .../plugins/jquery-ui/tests/unit/button/all.html | 30 ---- .../jquery-ui/tests/unit/button/button.html | 76 -------- .../jquery-ui/tests/unit/button/button_common.js | 14 -- .../jquery-ui/tests/unit/button/button_core.js | 199 --------------------- .../jquery-ui/tests/unit/button/button_events.js | 36 ---- .../jquery-ui/tests/unit/button/button_methods.js | 52 ------ .../jquery-ui/tests/unit/button/button_options.js | 117 ------------ 7 files changed, 524 deletions(-) delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/all.html delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button.html delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_common.js delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_core.js delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_events.js delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_methods.js delete mode 100644 97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_options.js (limited to '97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button') diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/all.html b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/all.html deleted file mode 100644 index f5c512e..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/all.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - jQuery UI Button Test Suite - - - - - - - - - - - - - -

jQuery UI Button Test Suite

-

-
-

-
    -
    - -
    - - diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button.html b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button.html deleted file mode 100644 index eeb5686..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - jQuery UI Button Test Suite - - - - - - - - - - - - - - - - - - -

    jQuery UI Button Test Suite

    -

    -
    -

    -
      -
      - -
      - -
      - - - -
      -
      -
      - - - -
      -
      -
      -
      - - - -
      -
      -
      -
      - - - -
      -
      - - - - -
      - -
      - - diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_common.js b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_common.js deleted file mode 100644 index ef22d30..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_common.js +++ /dev/null @@ -1,14 +0,0 @@ -TestHelpers.commonWidgetTests( "button", { - defaults: { - disabled: null, - icons: { - primary: null, - secondary: null - }, - label: null, - text: true, - - // callbacks - create: null - } -}); diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_core.js b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_core.js deleted file mode 100644 index 16c7ca4..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_core.js +++ /dev/null @@ -1,199 +0,0 @@ -/* - * button_core.js - */ - - -(function($) { - -module("button: core"); - -test("checkbox", function() { - expect( 4 ); - var input = $("#check"), - label = $("label[for=check]"); - ok( input.is(":visible") ); - ok( label.is(":not(.ui-button)") ); - input.button(); - ok( input.is(".ui-helper-hidden-accessible") ); - ok( label.is(".ui-button") ); -}); - -test("radios", function() { - expect( 4 ); - var inputs = $("#radio0 input"), - labels = $("#radio0 label"); - ok( inputs.is(":visible") ); - ok( labels.is(":not(.ui-button)") ); - inputs.button(); - ok( inputs.is(".ui-helper-hidden-accessible") ); - ok( labels.is(".ui-button") ); -}); - -function assert(noForm, form1, form2) { - ok( $("#radio0 .ui-button" + noForm).is(".ui-state-active") ); - ok( $("#radio1 .ui-button" + form1).is(".ui-state-active") ); - ok( $("#radio2 .ui-button" + form2).is(".ui-state-active") ); -} - -test("radio groups", function() { - expect( 12 ); - $("input[type=radio]").button(); - assert(":eq(0)", ":eq(1)", ":eq(2)"); - - // click outside of forms - $("#radio0 .ui-button:eq(1)").click(); - assert(":eq(1)", ":eq(1)", ":eq(2)"); - - // click in first form - $("#radio1 .ui-button:eq(0)").click(); - assert(":eq(1)", ":eq(0)", ":eq(2)"); - - // click in second form - $("#radio2 .ui-button:eq(0)").click(); - assert(":eq(1)", ":eq(0)", ":eq(0)"); -}); - -test("input type submit, don't create child elements", function() { - expect( 2 ); - var input = $("#submit"); - deepEqual( input.children().length, 0 ); - input.button(); - deepEqual( input.children().length, 0 ); -}); - -test("buttonset", function() { - expect( 6 ); - var set = $("#radio1").buttonset(); - ok( set.is(".ui-buttonset") ); - deepEqual( set.children(".ui-button").length, 3 ); - deepEqual( set.children("input[type=radio].ui-helper-hidden-accessible").length, 3 ); - ok( set.children("label:eq(0)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); - ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); - ok( set.children("label:eq(2)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); -}); - -test("buttonset (rtl)", function() { - expect( 6 ); - var set, - parent = $("#radio1").parent(); - // Set to rtl - parent.attr("dir", "rtl"); - - set = $("#radio1").buttonset(); - ok( set.is(".ui-buttonset") ); - deepEqual( set.children(".ui-button").length, 3 ); - deepEqual( set.children("input[type=radio].ui-helper-hidden-accessible").length, 3 ); - ok( set.children("label:eq(0)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); - ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); - ok( set.children("label:eq(2)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); -}); - -// TODO: simulated click events don't behave like real click events in IE -// remove this when simulate properly simulates this -// see http://yuilibrary.com/projects/yui2/ticket/2528826 fore more info -if ( !$.ui.ie || ( document.documentMode && document.documentMode > 8 ) ) { - asyncTest( "ensure checked and aria after single click on checkbox label button, see #5518", function() { - expect( 3 ); - - $("#check2").button().change( function() { - var lbl = $( this ).button("widget"); - ok( this.checked, "checked ok" ); - ok( lbl.attr("aria-pressed") === "true", "aria ok" ); - ok( lbl.hasClass("ui-state-active"), "ui-state-active ok" ); - }); - - // support: Opera - // Opera doesn't trigger a change event when this is done synchronously. - // This seems to be a side effect of another test, but until that can be - // tracked down, this delay will have to do. - setTimeout(function() { - $("#check2").button("widget").simulate("click"); - start(); - }, 1 ); - }); -} - -test( "#7092 - button creation that requires a matching label does not find label in all cases", function() { - expect( 5 ); - var group = $( "" ); - group.find( "input[type=checkbox]" ).button(); - ok( group.find( "label" ).is( ".ui-button" ) ); - - group = $( "" ); - group.filter( "input[type=checkbox]" ).button(); - ok( group.filter( "label" ).is( ".ui-button" ) ); - - group = $( "" ); - group.find( "input[type=checkbox]" ).button(); - ok( group.filter( "label" ).is( ".ui-button" ) ); - - group = $( "" ); - group.find( "input[type=checkbox]" ).button(); - ok( group.find( "label" ).is( ".ui-button" ) ); - - group = $( "" ); - group.filter( "input[type=checkbox]" ).button(); - ok( group.find( "label" ).is( ".ui-button" ) ); -}); - -test( "#5946 - buttonset should ignore buttons that are not :visible", function() { - expect( 2 ); - $( "#radio01" ).next().addBack().hide(); - var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" }); - ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) ); - ok( set.find( "label:eq(1)" ).is( ".ui-button.ui-corner-left" ) ); -}); - -test( "#6262 - buttonset not applying ui-corner to invisible elements", function() { - expect( 3 ); - $( "#radio0" ).hide(); - var set = $( "#radio0" ).buttonset(); - ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) ); - ok( set.find( "label:eq(1)" ).is( ".ui-button" ) ); - ok( set.find( "label:eq(2)" ).is( ".ui-button.ui-corner-right" ) ); -}); - -asyncTest( "Resetting a button's form should refresh the visual state of the button widget to match.", function() { - expect( 2 ); - var form = $( "
      " + - "" + - "" + - "
      " ), - button = form.find( "button" ).button(), - checkbox = form.find( "input[type=checkbox]" ).button(); - - checkbox.prop( "checked", false ).button( "refresh" ); - ok( !checkbox.button( "widget" ).hasClass( "ui-state-active" ) ); - - form.get( 0 ).reset(); - - // #9213: If a button has been removed, refresh should not be called on it when - // its corresponding form is reset. - button.remove(); - - setTimeout(function() { - ok( checkbox.button( "widget" ).hasClass( "ui-state-active" )); - start(); - }); -}); - -asyncTest( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() { - expect( 2 ); - var check = $( "#check" ).button(), - label = $( "label[for='check']" ); - ok( !label.is( ".ui-state-focus" ) ); - check.focus(); - setTimeout(function() { - ok( label.is( ".ui-state-focus" ) ); - start(); - }); -}); - -test( "#7534 - Button label selector works for ids with \":\"", function() { - expect( 1 ); - var group = $( "" ); - group.find( "input" ).button(); - ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" ); -}); - -})(jQuery); diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_events.js b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_events.js deleted file mode 100644 index 2fd0383..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_events.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * button_events.js - */ -(function($) { - -module("button: events"); - -test("buttonset works with single-quote named elements (#7505)", function() { - expect( 1 ); - $("#radio3").buttonset(); - $("#radio33").click( function(){ - ok( true, "button clicks work with single-quote named elements" ); - }).click(); -}); - -asyncTest( "when button loses focus, ensure active state is removed (#8559)", function() { - expect( 1 ); - - var element = $( "#button" ).button(); - - element.one( "keypress", function() { - element.one( "blur", function() { - ok( !element.is(".ui-state-active"), "button loses active state appropriately" ); - start(); - }).blur(); - }); - - element.focus(); - setTimeout(function() { - element - .simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ) - .simulate( "keypress", { keyCode: $.ui.keyCode.ENTER } ); - }); -}); - -})(jQuery); diff --git a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_methods.js b/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_methods.js deleted file mode 100644 index 467938f..0000000 --- a/97suifangqa/apps/indicator/static/plugins/jquery-ui/tests/unit/button/button_methods.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * button_methods.js - */ -(function($) { - - -module("button: methods"); - -test("destroy", function() { - expect( 1 ); - domEqual( "#button", function() { - $( "#button" ).button().button( "destroy" ); - }); -}); - -test( "refresh: Ensure disabled state is preserved correctly.", function() { - expect( 8 ); - - var element = $( "" ); - element.button({ disabled: true }).button( "refresh" ); - ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" ); //See #8237 - - element = $( "
      " ); - element.button({ disabled: true }).button( "refresh" ); - ok( element.button( "option", "disabled" ), "
      buttons should remain disabled after refresh" ); - - element = $( "" ); - element.button( { disabled: true} ).button( "refresh" ); - ok( element.button( "option", "disabled" ), "" ); - element.button( { disabled: true} ).prop( "disabled", false ).button( "refresh" ); - ok( !element.button( "option", "disabled" ), "Changing a